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.

limit as php variable

September 25, 2013 9:30am

Subscribe [0]
  • #1 / Sep 25, 2013 9:30am

    Leen_vdp

    1 posts

    Hello,

    I’m trying to set limit as a variable. Tried php, tries stash, tried embeds…tried everything i can imagine…

    In this code, the first <?php echo $limit; ?> gives me the right value (21)
    The second <?php echo $limit; ?> gives me limit=00o93H7pQ09L8X1t49cHY01Z5j4TT91fGfr

    If i remove the first <?php echo $limit; ?>, i get
    limit=”{exp:channel:entries channel='windowshopping' sort='desc' limit='1'}{amount}{/exp:channel:entries}”

    I think it has to do with parse order, but i don’t understand….

    <?php $limit="{exp:channel:entries channel='windowshopping' sort='desc' limit='1'}{amount}{/exp:channel:entries}"; ?>
    
    <?php echo $limit; ?>
    
    {exp:channel:entries channel="looks" limit="<?php echo $limit; ?>" sort="desc" orderby="date"}
    ....
    {/exp:channel:entries}
  • #2 / Sep 25, 2013 10:39am

    Leen_vdp

    1 posts

    Adding ‘parse=“inward”’ did it 😊

    {exp:channel:entries channel="looks" limit="<?php echo $limit; ?>" sort="desc" orderby="date" parse="inward"}
    ....
    {/exp:channel:entries}
.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases