Forum for discussing general topics related to Couch.
3 posts Page 1 of 1
Hi all, Iwas wondering if any of you would have an idea about embedded comments here:

The setup:
A smal couchified website with kinda mosaic / pagebuilder admin - in admin you select a predefined component to be displayed in the <cms:show_mosaic 'content' >, get a modal to add your text and images, select background color, etc., save, save and off you go. The entire mosaic content is embedded, so in the (static) php page I simply have <cms:embed 'mosaic-content.html' />. All components so far work flawlessly, except for the comments.

The comments:
I took and modified the Couch comments example (both the form and comments display) and put in the embedeed mosaic-content.html file along with other blocks. The comment section (as wit every other block) says
Code: Select all
<cms:if k_tile_name='comments' >
   <section>
      the comments form + comments list as modified from the Couch example
   </section>
</cms:if>

The issue:
If I select the Comments tile in the admin, on the front end I get the comments form, bud not the comments list, not a trace. If I take the entire Comments things from the emdedded file and place it into the php page source directly, however, I get both the form and the comments list.

I was able to narrow the issue down to the page_id=k_page_id in the <cms:comments ...> tag - if I remove that, it does work even from the embedded file. From dump I see the embedded mosaic file has k_page_id 84, while the php page has k_page_id 68 - so I guess that is why (comments from the embedded mosaic file do not display in the page).

The question
thus basically is threefold:
    - Where do the individual mosaic tiles) take the page_if from ... considering thy are not pages per se? I thought <embed> was only inserting text...
    - Is my understanding correct that without the k_page_id parameter the list would display all site comments, no matter on what page they were submited?
    - If so, is there a way to overcome this? Looking at available parameters, I cannot operate with masterpage (it is a static php page), nor wtth page_name (not to be seen i the dump). Would you have an idea ... perhaps even adding some select field in the Comments tile? What comes to mind is showing / hiding the entire comments block this way instead of using a mosaic tile...

Well, it is not a showstopper for me, but since I like this concept of taking couchified static pages another bit farther with the mosaic and am essentially allowing inserting multiple comments tiles anywhere, it wold be nide to have this troubleshooted...

Should you have a suggestion, thanks a lot in advance!
Mosaic operates with its own ids; internally tile instances are 'cloned pages' with tile definition itself being their 'masterpage', that's how they are coded in Couch. You need to change the comments tag parameter page_id to the value of the holding page.

To access outer k_page_id you may save outer value to a new 'global' variable and have it used within inner blocks (where inner k_page_id value is different from the outer one) -
page_id=my_page_id
Thanks for the explanation, trendoman!

I eventually decided to live without that (as there will only be one commentable page with access restriction and the client only wants an extremely simple chatboard) ... but for the sake of it I will definitely try that - haven`t yet really worked with setting up global vars.
3 posts Page 1 of 1
cron