ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Linking from within "Templates" directory

July 18, 2007 3:51pm

Subscribe [0]
  • #1 / Jul 18, 2007 3:51pm

    Christian Sweatt

    281 posts

    How do I link to items located inside my “templates” folder inside my system directory?

  • #2 / Jul 18, 2007 4:25pm

    Stephen Slater

    366 posts

    I’m not sure what you mean?

    If you just want to link to templates within your template groups, you would use the Path Global Variable.

  • #3 / Jul 18, 2007 4:43pm

    Christian Sweatt

    281 posts

    Sorry, let me be more clear.

    Instead of putting my images (or any files for my site) in the root, I’d like to put them in

    root > system > templates > images (or any other file I want to put there)

    So, in the template editor, I would imagine linking to, let’s say, a pdf file like this:

    <a href="/templates/pdf/filename.pdf">

    This doesn’t work though…  I’ve also tried

    ./templates/pdf/etc.
    system/templates/pdf/etc.
    /pdf/etc.

    I hope this makes more sense.

    Thanks!

  • #4 / Jul 18, 2007 4:57pm

    Stephen Slater

    366 posts

    Most people suggest using an absolute URL path to your files.  It would be best to setup a variable that writes out the root and then continue with your path.

    Make sense?

  • #5 / Jul 18, 2007 5:06pm

    Christian Sweatt

    281 posts

    ...setup a variable that writes out the root and then continue with your path.

    Makes sense, but I’m still quite new to EE, so what variable would I use to do that?

  • #6 / Jul 18, 2007 5:23pm

    Stephen Slater

    366 posts

    Check out this thread.

    They are discussing the site_url variable as it relates to CSS, but it applies to your question as well.

  • #7 / Jul 18, 2007 5:26pm

    Christian Sweatt

    281 posts

    Excellent!  Thank you so much!  I’ll try that.

    One more thing, is there some sort of a tag library which lists all the tags currently supported by EE?  I’ve looked around in a couple of places, but was unable to come up with much.  I know the pMachine docs had one, but I haven’t been able to locate one in the EE docs.

  • #8 / Jul 18, 2007 5:34pm

    Stephen Slater

    366 posts

  • #9 / Jul 18, 2007 5:46pm

    Christian Sweatt

    281 posts

    Hmmm…  Yes, I saw that one, but it doesn’t really tell you *how* the tags are used.  I guess I’ll just print it out and start playing around.  I suppose that’s the best way to learn, right?!

    Thanks again for your help!

  • #10 / Jul 18, 2007 5:55pm

    Stephen Slater

    366 posts

    no no no 😊 ...

    Have you been through the documentation?

    Specifically, the “modules and tags” section?  There is complete coverage of all the tags, variables, etc.. within this section.  Make sure you check out the “templating system” too.  There are a lot of standard variables, user defined variables, etc.. in there.  These are indispensable when working with EE.

    Also, depending how new and familiar you actually are, I’d suggest starting with the video tutorials.

    EDIT ADD:
    parameters, conditional variables, single variables, variable pairs, etc…

    Global Template Variables

    Good luck!

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases