Problems, need help? Have a tip or advice? Post it here.
43 posts Page 2 of 5
Code: Select all
<cms:pages masterpage='one.php'>
    [some code to get just one specific cloned page from one.php]
    <cms:get_custom_field 'k_page_title' masterpage='another.php' page="<cms:show var1/>"/>
</cms:pages>

Problem with the code above is that get_custom_field can only fetch in custom fields (i.e. those defined by using cms:editable tags) and 'k_page_title' is not a custom field but a system one.

But that is not a problem, we can always use the 'pages' tag to do the same thing -
Code: Select all
<cms:pages masterpage='one.php'>
   [some code to get just one specific cloned page from one.php]
   <cms:pages masterpage='another.php' page_name=var1>
      <cms:show k_page_title />
   </cms:pages>
</cms:pages>

Do let me know if this worked.
It does, thanks again!
And why does this not work? :)
Code: Select all
<cms:repeat count="3" startcount='1'>
                  <cms:set "var_<cms:show k_count />"="varA_<cms:show k_count />" 'global'/>
</cms:repeat>
That is because the LHS of the expression in 'set' needs to be a variable (no quotes) and you are using a string.

If you really must use such a loop, we can use a PHP loop instead and then use it to generate Couch statements -
Code: Select all
<?php for( $x=1; $x<=3; $x++ ): ?>
   <cms:set var_<?php echo $x; ?>=varA_<?php echo $x; ?> 'global'/>
<?php endfor; ?>

The code above actually results in the generation of the following standard Couch statements -
Code: Select all
   <cms:set var_1=varA_1 'global'/>
   <cms:set var_2=varA_2 'global'/>
   <cms:set var_3=varA_3 'global'/>

Did this help? Please let me know.
yes, thanks!
When I use limit with <cms:pages [...] I have the problem that it shows one entry less than I defined in limit. I had this problem some days ago already but then it fixed itself miracously by itself. Now I included another page and I have the problem again. I guess it will fix itself at some point, but it's still strange. Known problem?

And: Is there something like k_newest_page or something with wich I can access the first of the pages <cms:pages masterpage='... throws out?
Hi,

Maybe you are encountering the bug discussed in this post viewtopic.php?f=4&t=1467

Please check the publish date of the post not appearing and let me know.
Thanks
Added some clones and it's working again. I guess my way of collecting the pages is causing it, since I only display the item if its available in the selected language. So if one newsitem is only available in german, it won't get displayed in the english version. So the german page shows three items, the english only two. I will have to find another way or live with it :).

Is there something like k_newest_page or something with wich I can access the first of the pages <cms:pages masterpage='... throws out?
Is there something like k_newest_page or something with wich I can access the first of the pages <cms:pages masterpage='... throws out?

Code: Select all
<cms:pages masterpage='whatever.php' limit='1'>
   ..[you get the latest page here]
</cms:pages>
If I may say so, from what I could gather from your queries so far, you seem to be taking a very unconventional way of structuring your site.

Would it be possible for you to post in a little description of how exactly you are trying to get things done - I mean what are templates created, how you are using the non-executable templates etc.

Would help me get the bigger picture wherein to fit the queries you have.

Thanks :)
43 posts Page 2 of 5