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.

Path tag variables in nested embeds: urls stop working

June 15, 2008 1:10am

Subscribe [3]
  • #1 / Jun 15, 2008 1:10am

    Haydar

    2 posts

    Hi,
    
    First post: great software, just trying to get on the curve.
    
    I have a footer:
    
    <div id="footer">
    <div class="footer-i">
    <a href="http://{path={my_template_group}/rss_2.0}">RSS 2.0</a> . <a href="http://{path={my_template_group}/atom}">Atom</a> . 
    <a href="http://validator.w3.org/check?uri=referer" title="Valid XHTML">XHTML</a> . <a href="http://jigsaw.w3.org/css-validator/check/referer" title="Valid CSS">CSS</a>
    The original template for this web site was designed by <a href="http://orangescale.com/">Thomas Arie Setiawan</a>
    </div>
    </div>
    
    that returns this valid url for the rss link:
    
    <a href="http://wmscounseling.org/index.php/6th-grade/rss_2.0">http://wmscounseling.org/index.php/6th-grade/rss_2.0</a>
    
    When I put the same footer code into the "footer" template in the template group "code-snippets", and then put the following code in place of the entire footer code on the 6th-grade page template:
    
    (embed="code-snippets/footer"}
    
    I get this invalid url:
    
    <a href="http://wmscounseling.org/index.php/{my_template_group//rss_2.0}">http://wmscounseling.org/index.php/{my_template_group//rss_2.0}</a>
    
    This happens even if I add this variable to the embed:
    
    (embed="code-snippets/footer" my_template_group="{my_template_group}"}
    
    What am I not understanding? (I'm having similar problems with a nested header embed, etc.)
    
    Thanks for any help.

    EDIT: Added code coloring.

  • #2 / Jun 15, 2008 2:23am

    Danny T.

    426 posts

    Think Greg handled this better than I did.. Kudos mate. 😊

  • #3 / Jun 15, 2008 2:33am

    Greg Aker

    6022 posts

    Haydar:

    Welcome!

    In your main templates, what about:

    {embed="code-snippets/footer" my_template_group="{my_template_group}"}

    and in the common, embedded template:

    <div id="footer"> 
    <div class="footer-i"> 
    <a href="http://{path={embed:my_template_group}/rss_2.0}">RSS 2.0</a> . <a href="http://{path={embed:my_template_group}/atom}">Atom</a> . 
    <a href="http://validator.w3.org/check?uri=referer" title="Valid XHTML">XHTML</a> . <a href="http://jigsaw.w3.org/css-validator/check/referer" title="Valid CSS">CSS</a> 
    The original template for this web site was designed by <a href="http://orangescale.com/">Thomas Arie Setiawan</a> 
    </div> 
    </div>

    Hope that helps,

    -greg

    ps:  the “code” buttons on the posts can help people to see what you’re doing, and thus making responses easier.  😊


    Edit:  Misspelling & Mistake

  • #4 / Jun 15, 2008 1:26pm

    Haydar

    2 posts

    Thanks, Greg. In my post, I had already tried the first part of your tip, thanks to previous forum postts (I think this became much clearer to the reader after I added the code tag, as you suggested). But I had completely missed the embed: part of the variable in the footer template. When I went back to the documentation to re-read the embeds section it made sense this time, and I think I’ve got it now. The code passes the URLs just fine. I appreciate the education!

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

ExpressionEngine News!

#eecms, #events, #releases