First off I'm new here so apologies if this is posted in the wrong place. Secondly I have *NO* experience of php so go easy on me!
I'm building a site that has a news feature iframe appearing on several pages
On some pages this iframe has random content in it - selected from a max of 4 items.
On other pages it needs to contain fixed content.
My client would like the facility to alter whether the pages contain random or fixed content himself. He cannot code! What is the easiest way of achieving this?
Many thanks
Client selectable iframe content
Moderator: General Moderators
the easest way I can think of doing this would be to when you set the source for the IFRAME is to pass along another variable that tells the page what to load.
would load the first page of static content.
would load a random page
on the loadedIframePage.html your page could test in javascript what was passed and if it was 0 do a random selection page. if it isn't 0 then load the static page.
the last bit could also be done in php which would be alot nicer and easily done.
Code: Select all
document.getElementById('frameName').src = 'loadedIframePage.html?load=1';Code: Select all
document.getElementById('frameName').src = 'loadedIframePage.html?load=0';on the loadedIframePage.html your page could test in javascript what was passed and if it was 0 do a random selection page. if it isn't 0 then load the static page.
the last bit could also be done in php which would be alot nicer and easily done.