Welcome to TalkGraphics.com
Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1

    Default Use placeholder for menu code that will change often?

    Developing a new site, the menus will continually need updating as new pages are added. Can one create a placeholder for the code for the menu, name it as a repeating item, then change the code once and have it update throughout the site?
    IP

  2. #2

    Default Re: Use placeholder for menu code that will change often?

    Hi Shaun, Welcome to the Forum.

    So long as you save your .web file yes, you can update this as often as you need to in Web Designer and then have it update repeating items prior to republishing the changes.

    You cannot however update the source code in this way 'after' publishing.
    IP

  3. #3
    Join Date
    Sep 2000
    Location
    London, UK
    Posts
    1,436

    Default Re: Use placeholder for menu code that will change often?

    Hi

    I have not tried this, but if you include a placeholder which does an include to a file containing the stuff you want to change, within your site structure, then when the browser pulls in the published page it should also pull in your menu.
    Simon
    ------------------------------
    www.tlaconsultancy.co.uk
    www.bricksandbrass.co.uk
    IP

  4. #4
    Join Date
    Jul 2008
    Location
    Phoenix, AZ
    Posts
    267

    Default Re: Use placeholder for menu code that will change often?

    One thing I tried and it worked:

    Draw the placeholder. Bring up the web properties. Select 'Replace with HTML code' and in the box put something like:

    <? include 'filename.php'; ?>

    filename.php is the name of the dynamic content. The file can be filename.txt, filename.php, filename.html, it doesn't really matter.

    Create the content for your placeholder save it as the name you used above.

    Save your page(s). Rename the pages from .htm or .html to .php so that the server will parse the pages looking for php.

    Upload and test.

    Now if you want the content to change within your placeholder,simply make the change to the file with your dynamic content, upload it and replace the file on your server, and all your pages should then be updated where the placeholder was used.
    Chris
    LotsMoreHosting.com
    IP

  5. #5

    Default Re: Use placeholder for menu code that will change often?

    "Include"--Awesome. Not a word I use often. Shaun
    IP

  6. #6

    Default Re: Use placeholder for menu code that will change often?

    Note" While <? include 'filename.php'; ?> will work as mentioned above, be certain that your web host will parse PHP. Some servers or lite hosting accounts do not support PHP.
    Also note that the content of the file your include calls can never exceed the dimensions of the placeholder object, which is not dynamically re sizable according to the content which is 'filling' it..
    IP

  7. #7
    Join Date
    Aug 2004
    Location
    Ukraine
    Posts
    3,904

    Default Re: Use placeholder for menu code that will change often?

    Quote Originally Posted by sledger View Post
    Also note that the content of the file your include calls can never exceed the dimensions of the placeholder object, which is not dynamically re sizable according to the content which is 'filling' it..
    Well, it can't resize dynamically, but it can be scrolled if needed:

    <div style="overflow:scroll;"><? include 'filename.php'; ?></div>
    John.
    IP

  8. #8

    Default Re: Use placeholder for menu code that will change often?

    OK, second question. Can a placeholder be soft-grouped with a page-depth panel so the page lengthens to fit the placeholder-contents depth? Seems not.

    I am trying to redesign an existing site, at the same time switching to WD. To change the site's architecture I can dump old code into a placeholder in the new site design, and WB nicely places the old content in place. Of course, I'd like to put the existing page contents into a placeholder and have WD lengthen the page to fit. Conversion of the site would then be speedy; I would make dup pages and dump content code for page after page into each page's content placeholder and get functioning pages the right length. Then I would redesign each page at my leisure in WD itself.

    Any workaround? Can I put an iframe link in the placeholder so I get a scrollable frame showing the content in a separate file?
    IP

  9. #9
    Join Date
    Aug 2004
    Location
    Ukraine
    Posts
    3,904

    Default Re: Use placeholder for menu code that will change often?

    Quote Originally Posted by shaun2000 View Post
    Can a placeholder be soft-grouped with a page-depth panel so the page lengthens to fit the placeholder-contents depth? Seems not.
    Yes, it's impossible as far as I know.

    Any workaround? Can I put an iframe link in the placeholder so I get a scrollable frame showing the content in a separate file?
    Yes you can use iFrame (read here: http://www.talkgraphics.com/showthread.php?t=36753), but you can also include your code into a scrollable div within a placeholder:

    <div style="overflow: scroll;">
    ...your code here...
    </div>
    John.
    IP

  10. #10

    Default Re: Use placeholder for menu code that will change often?

    Quote Originally Posted by covoxer View Post
    Well, it can't resize dynamically, but it can be scrolled if needed:

    <div style="overflow:scroll;"><? include 'filename.php'; ?></div>
    Good point John, that would work well for particular content.

    BTW: My mention of the non-dynamic nature of placeholders was a 'reminder' rather than any criticism
    IP

 

 

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •