Problems, need help? Have a tip or advice? Post it here.
2 posts Page 1 of 1
Hello,

I've set up a clonable template and within the code I've used a <cms:if k_is_page > tag to display the pages content else it displays the list of all the pages generated with the template.

This all works fine. The thing that I'm trying to figure out is how to create a link on each of the "list items" on the list view that links to its respective page.

I can't seem to find any documentation on this, only this page: http://docs.couchcms.com/tags-reference/link.html
But it doesn't say what to put in the page='' area to make it dynamic.

See my code below. Line 37 is where the link should be.

Code: Select all
<cms:if k_is_page >
         <div class="item span_responsive_3">
            <div class="item-img">
               <div class="product-image-full">
                  <img src="<cms:show product_image />" class="product-image-preview" width="382" height="337" alt="<cms:show k_page_title />" title="<cms:show k_page_title />">
               </div>
            </div>
            <div class="item-desc">
               <div class="product-details">
                  <cms:pp_product_form class="cart-form">
                     <div class="product-top-box">
                        <h1 class="product-headline"><cms:show k_page_title /></h1>
                        <h2 class="product-price-big">$<cms:number_format pp_price /></h2>
                        <p><cms:excerpt count='50'><cms:show product_desc /></cms:excerpt></p>
                        <div class="purchase-box">
                           <label class="quantity-label">Qty:</label>
                           <input class="product-quantity" type="number" name="qty" min="1" step="1" value="1" title="Quantity">
                           <input class="btn product-add" type="submit" value="Add to Cart">
                        </div>
                     </div>
                     <div class="product-options">
                                <cms:pp_product_options >
                                    <label><cms:show option_name />:</label><br>
                                    <cms:pp_option_values /><br>
                                </cms:pp_product_options >
                     </div>
                  </cms:pp_product_form>
               </div>
            </div>
         </div>
         
      <cms:else />
         <!-- List view -->
         <cms:if k_is_home >
            <cms:pages order order='asc'>
               <div class="item span_responsive_3">
                  <<<<<This is where I want the link>>>>><a href="<cms:link masterpage='news.php' page=k_page_id />">Testing Link tag</a>
                  <div class="item-img">
                     <div class="product-image-full">
                        <img src="<cms:show product_image />" class="product-image-preview" width="382" height="337" alt="<cms:show k_page_title />" title="<cms:show k_page_title />">
                     </div>
                  </div>
                  <div class="item-desc">
                     <div class="product-details">
                        <cms:pp_product_form class="cart-form">
                           <div class="product-top-box">
                              <h1 class="product-headline"><cms:show k_page_title /></h1>
                              <h2 class="product-price-big">$<cms:number_format pp_price /></h2>
                              <p><cms:excerpt count='50'><cms:show product_desc /></cms:excerpt></p>
                              <div class="purchase-box">
                                 <label class="quantity-label">Qty:</label>
                                 <input class="product-quantity" type="number" name="qty" min="1" step="1" value="1" title="Quantity">
                                 <input class="btn product-add" type="submit" value="Add to Cart">
                              </div>
                           </div>
                           <div class="product-options">
                              <cms:pp_product_options >
                                 <label><cms:show option_name />:</label><br>
                                 <cms:pp_option_values /><br>
                              </cms:pp_product_options >
                           </div>
                        </cms:pp_product_form>
                     </div>
                  </div>
               </div>
            </cms:pages>
         </cms:if>
      </cms:if>
Doesn't following work?
Code: Select all
<a href="<cms:show k_page_link />">Testing Link tag</a>
2 posts Page 1 of 1
cron