Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Feb 2005
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post Filling a div with contents from another html page?

    Im pretty nooby at this, but I wondered, if its possible to fill the contents of a div with imported html from an other html file, kind of similar to the way in which frames used to work. I want to add a list of links to my page and all the subpages, but I want to be able to change the contents of this link div at a later lime, simply by editing the "links.html" or something like that - thus not having to copy paste the changed div content into all the pages seperatly.

    I have seen in for instance pivot's php stuff that they use tags like [[link page]] on their templates, which results in the html of a file called something like aux_links.html ending up in a certain div on the final rendered php page, but I guess that requires hard-core scriptisch which I'm not capable of.

    Illustration:
    This is from the index page template from Pivot,

    <div class="block">
    <h2>[[label:links]]</h2>
    <p>[[link_list]]</p>
    </div>


    which together with a file called _aux_link_list.html which is simply a bunch of links in a paragraph:
    <p><a href="http://www.google.com/">a bunch of links</a></p>

    results into this on the rendered page:

    <div class="block">
    <h2>Links</h2>
    <p><a href="http://www.google.com/" target='_blank'>a buch of links</a></p>
    </div>


    I love the way this works for Pivot, but now I want to use something similar on another page, which isn't a weblog, and for which I have not done any php or javascript or whatver - I wouldn't even know how to.

    Is there an easy (html/css) way of accomplising stuff like this? Or perhaps a not so difficult way of scripting that I might be able to understand (I learn quick)? Or even maybe some standard script example already availiable somewhere I didn't find?

  • #2
    Regular Coder Graft-Creative's Avatar
    Join Date
    Aug 2004
    Location
    Web Designer - North East Lancashire U.K.
    Posts
    842
    Thanks
    0
    Thanked 0 Times in 0 Posts

  • #3
    New Coder
    Join Date
    Feb 2005
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Is it really that easy? Just making a php out of it and using the include fucntion? I'm going to try, I'll keep y'all updated. (Like anyone cares, haha)

  • #4
    New Coder
    Join Date
    Feb 2005
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    WTF, it worked, thanks a lot dude! Ain't learning stuff hell!


  •  

    Posting Permissions

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