Problems, need help? Have a tip or advice? Post it here.
7 posts Page 1 of 1
If I wanted list view of a clonable page to display a page with a specific ID, is there any way to do that?
A page-view is available anywhere with cms:pages. Details about parameters are in docs, also id=id-of-yourpage. If you have more specific request, please explain. :)
Join COUCH:TALK channel here https://t.me/couchcms_chat
Ryazania — a framework to boost productivity with Add-ons viewtopic.php?f=2&t=13475
Support my efforts to help the community https://boosty.to/trendo/donate
trendoman wrote: A page-view is available anywhere with cms:pages. Details about parameters are in docs, also id=id-of-yourpage. If you have more specific request, please explain. :)


I'm reading the docs and I'm not seeing any way to do what I'm asking.
I'm not understanding some part of this.

Code: Select all
<cms:if k_is_home>
    <cms:pages masterpage='book.php' id='1'>
      Do I have to duplicate the entirety of my html here?
    </cms:pages>
<cms: else />
    Main HTML
</cms:if>
Do I have to duplicate the entirety of my html here?

Yes. To avoid duplication you may place the HTML in a snippet and then call the same snippet at both the locations as follows (code assumes you have named the snippet 'book_details.html')
Code: Select all
<cms:if k_is_home>
    <cms:pages masterpage='book.php' id='1'>
      <cms:embed 'book_details.html' />
    </cms:pages>
<cms: else />
    <cms:embed 'book_details.html' />
</cms:if>


As an alternative, you can redirect the visitor to the first page when she lands on the home page e.g. as follows -
Code: Select all
<cms:if k_is_home>
    <cms:pages masterpage='book.php' id='1'>
      <cms:redirect k_page_link />
    </cms:pages>
<cms: else />
    Main HTML
</cms:if>

Hope it helps.
KK wrote: As an alternative, you can redirect the visitor to the first page when she lands on the home page e.g. as follows -
Code: Select all
<cms:if k_is_home>
    <cms:pages masterpage='book.php' id='1'>
      <cms:redirect k_page_link />
    </cms:pages>
<cms: else />
    Main HTML
</cms:if>

Hope it helps.


That's likely what I'll do

Though I'd probably do it like this (unless there's a reason not to?)


Code: Select all
<cms:if k_is_home>
    <cms:redirect url="<cms:link masterpage='book.php' page='test-page' />" />
<cms:else />
rest of the normal page


But in searching the forum I found what appears to be an undocumented masquerade tag? It appears to work, but I can't find any mention of it outside a single forum post.

Here: https://www.couchcms.com/forum/viewtopic.php?f=4&t=7046

Is there a reason to not use that?

Code: Select all
<cms:if k_is_home>
    <cms:masquerade url="<cms:link masterpage='book.php' page='test-page' />"/>
<cms:else />
rest of the normal page
I question the whole redirect thing.

Landing on site.com/gallery/ would redirect me as per your setup to site.com/gallery/davinci.html in the best case :D or
site.com/some-other-template/ :?

Can you tell me why this is required?
Also, from the point of seo, home/list view serves role of a hub to other pages, so if your setup is different, it is very interesting to know more about what you are trying to accomplish.
Join COUCH:TALK channel here https://t.me/couchcms_chat
Ryazania — a framework to boost productivity with Add-ons viewtopic.php?f=2&t=13475
Support my efforts to help the community https://boosty.to/trendo/donate
trendoman wrote: I question the whole redirect thing.

Landing on site.com/gallery/ would redirect me as per your setup to site.com/gallery/davinci.html in the best case :D or
site.com/some-other-template/ :?

Can you tell me why this is required?
Also, from the point of seo, home/list view serves role of a hub to other pages, so if your setup is different, it is very interesting to know more about what you are trying to accomplish.


It's for a story, I want

site.com/book/ to go to the first page, at which point there will be next buttons to advance

I'm going to have a sitemap/toc elsewhere
7 posts Page 1 of 1