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.

Variable Variables in Template?

March 14, 2011 2:33pm

Subscribe [2]
  • #1 / Mar 14, 2011 2:33pm

    Napco

    19 posts

    Is it possible to generate a variable variable with the following code, specifically the value for the “show” argument?

    I have the PHP parsing set to input, and this does work for outputting text, but it does not seem to work for what I have in mind.

    {exp:weblog:categories weblog="{embed:my_blog}" parent_only="no" show_empty="no" style="linear" show="{<?php echo '{embed:my_blog}' ?>_navbar_categories}"}

    ExpressionEngine 1.6.7
    Build:  20090320

  • #2 / Mar 15, 2011 5:45am

    John Henry Donovan

    12339 posts

    Napco,

    that’s not going to work you would need to approach it like

    <?php
    
    $cats = '1|3|4';
    
    ?>
    {exp:weblog:categories weblog="{embed:my_blog}" parent_only="no" show_empty="no" style="linear" show="<?php echo $cats ?>"}

    And do whatever you need to create that list of IDs outside the categories tag itself. Not knowing your set-up I can’t say how you would do that.

    I can move this thread to the CodeShare corner if you wish to have some Community help on this one?

  • #3 / Mar 16, 2011 9:39am

    Napco

    19 posts

    I wound up going another route, thanks anyway.

  • #4 / Mar 16, 2011 2:05pm

    Lisa Wess

    20502 posts

    Glad you found a solution, Napco.  If there’s anything else we can help with, please make a new post.  Thank you!

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

ExpressionEngine News!

#eecms, #events, #releases