Forum for discussing general topics related to Couch.
9 posts Page 1 of 1
Hi all!

Does couch support article tags and if yes, how do I implement them in my template? So I would have to be able to write tags by myself, but those tags needs to be connected with other tags from other articles.
Hi,

Please see viewtopic.php?f=8&t=8952

Hope it helps.
That helps in one way. I managed to create tags and include them in article. Now I have problem when I click on one of the tags, new page should open with all articles that have that tag in it. How to set up that tag page?
Please give the referred post a second reading - it describes what you want. An excerpt from it -
Each of the tag shown above leads to the tags.php template's page_view where we can display all the blog posts related to that particular term
Code: Select all
<cms:set my_custom_field_str="tags=<cms:show k_page_name />" />
               <cms:query
                   sql="SELECT p.id, p.template_id
                       FROM <cms:php>echo K_TBL_PAGES;</cms:php> p
                       inner join <cms:php>echo K_TBL_TEMPLATES;</cms:php> t
                       on p.template_id = t.id
                       WHERE (t.name='web-trendovi.php' or t.name='internet-usluge.php')
                       AND publish_date < '<cms:date format='Y-m-d H:i:s' />'
                       AND NOT publish_date = '0000-00-00 00:00:00'
                       ORDER BY publish_date desc;"
                   fetch_pages='1'
                   >
               <div class="blog-posts">
 
                  <article class="post post-medium">
                                 <div class="post-content">

                                 <h2><a href="<cms:show k_page_link />"><cms:show k_page_title /></a></h2>

                                 <cms:if k_template_name='web-trendovi.php'>
                                 <p class="blog-tekst"><cms:excerptHTML trail="&nbsp;(...)" count='60' ignore='img' ><cms:show blog_sadrzaj /></cms:excerptHTML></p>

                                 <cms:else_if k_template_name='internet-usluge.php' />
                                 <p class="blog-tekst"><cms:excerptHTML trail="&nbsp;(...)" count='60' ignore='img' ><cms:show usluga_sadrzaj /></cms:excerptHTML></p>

                                 </cms:if>

                                 <span class="d-block d-md-inline-block float-md-right mt-3 mt-md-0"><a href="<cms:show k_page_link />" title="<cms:show k_page_title />" alt="<cms:show k_page_title />" class="btn btn-primary btn-lg btn-send">Pročitaj više</a></span>
                                 </div>
                  </article>
               </div>
               </cms:query>


I'm using this code. This code shows all articles from masterpages "web-trendovi.php" and "internet-usluge.php", not only those connected with specific tag. What should I change, where's the problem?
The 'relation' feature works only with a single template.
In your code you are trying to fetch in pages from multiple templates so, I am sorry, the solution I suggested won't work for your use-case.
Any other way to do it?
It would be possible to use the <cms:query> tag to execute a custom SQL instruction. I can take a look if you PM me cPanel/database creds
I've created two separate "tag" pages for two template pages.
9 posts Page 1 of 1
cron