Forum for discussing general topics related to Couch.
12 posts Page 2 of 2
@Bartonsweb, you've got a perfect spot to use else_if
Code: Select all
<title>
    <cms:if k_is_page >
        <cms:show page_title />
    <cms:else />
        <cms:if k_is_folder || k_is_archive>
            <cms:show page_title />
        <cms:else_if k_is_home />
            <cms:get_custom_field 'page_title' masterpage=k_template_name />
        </cms:if>
    </cms:if>
</title>


I agree with you, that the code is real mess, especially with weird php, which is totally unnecessary.
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: @Bartonsweb, you've got a perfect spot to use else_if

I agree with you, that the code is real mess, especially with weird php, which is totally unnecessary.


I was tempted to use else_if, but I didn't want to confuse more than necessary as the code was very similar to what is shown on the views concepts page. But you are correct, else_if makes it much easier and simpler to write those statements. :)
Image
12 posts Page 2 of 2