Problems, need help? Have a tip or advice? Post it here.
4 posts Page 1 of 1
we're working now on creating authors pages for my site blog, issue is that when we click on the "author name" it links to the list of authors how can we solve this? We need to have author linked to each one of them

here you can see the problem by clicking on the authors: http://www.designdiverso.com/thoughts.php
I'll assume that the authors.php template is clonable.
From what can be seen on the link you posted, you are linking blog posts to the 'home-view' of authors.php. They should actually be linked to the 'page-view' of authors.php (i.e. a single author cloned page).

Can you please let us know how are the blog posts related to the authors? (I mean, the code you are using to create the relation between the two templates and then fetch the data back e.g. the author related to the a blog-post).
as required here is the code used in order to create authors page, we haven't used any relations though.

Please check it out and get back to us, we're looking forward to solve this issue with you help

trying to attach the file to no avail, what format is allowed on here?

hope this helps, this is the actual template we're using, looking forward to solve the issue with your assistance asap



Code: Select all
<?php require_once( 'cms/cms.php' ); ?>
   <cms:embed 'lang_getter.html' />
<cms:template title='Author' clonable='1' commentable='1'>
<cms:editable name="en_author_name" type='text'/>
<cms:editable name="fi_author_name" type='text' />
<cms:editable name="en_author_job" type='text' />
<cms:editable name="fi_author_job" type='text' />
<cms:editable name="en_author_about" type='text' />
<cms:editable name="fi_author_about" type='text' />
<cms:editable name="author_avtar"

      crop='1'
     width='880'
     height='299'
     type='image'
/>
</cms:template>

<!DOCTYPE html>
<html>
<head>
   <meta charset="utf-8">
   <meta http-equiv="X-UA-Compatible" content="IE=edge"><script type="text/javascript">window.NREUM||(NREUM={}),__nr_require=function(t,e,n){function r(n){if(!e[n]){var o=e[n]={exports:{}};t[n][0].call(o.exports,function(e){var o=t[n][1][e];return r(o?o:e)},o,o.exports)}return e[n].exports}if("function"==typeof __nr_require)return __nr_require;for(var o=0;o<n.length;o++)r(n[o]);return r}({QJf3ax:[function(t,e){function n(t){function e(e,n,a){t&&t(e,n,a),a||(a={});for(var c=u(e),f=c.length,s=i(a,o,r),p=0;f>p;p++)c[p].apply(s,n);return s}function a(t,e){f[t]=u(t).concat(e)}function u(t){return f[t]||[]}function c(){return n(e)}var f={};return{on:a,emit:e,create:c,listeners:u,_events:f}}function r(){return{}}var o="nr@context",i=t("gos");e.exports=n()},{gos:"7eSDFh"}],ee:[function(t,e){e.exports=t("QJf3ax")},{}],gos:[function(t,e){e.exports=t("7eSDFh")},{}],"7eSDFh":[function(t,e){function n(t,e,n){if(r.call(t,e))return t[e];var o=n();if(Object.defineProperty&&Object.keys)try{return Object.defineProperty(t,e,{value:o,writable:!0,enumerable:!1}),o}catch(i){}return t[e]=o,o}var r=Object.prototype.hasOwnProperty;e.exports=n},{}],D5DuLP:[function(t,e){function n(t,e,n){return r.listeners(t).length?r.emit(t,e,n):(o[t]||(o[t]=[]),void o[t].push(e))}var r=t("ee").create(),o={};e.exports=n,n.ee=r,r.q=o},{ee:"QJf3ax"}],handle:[function(t,e){e.exports=t("D5DuLP")},{}],XL7HBI:[function(t,e){function n(t){var e=typeof t;return!t||"object"!==e&&"function"!==e?-1:t===window?0:i(t,o,function(){return r++})}var r=1,o="nr@id",i=t("gos");e.exports=n},{gos:"7eSDFh"}],id:[function(t,e){e.exports=t("XL7HBI")},{}],loader:[function(t,e){e.exports=t("G9z0Bl")},{}],G9z0Bl:[function(t,e){function n(){var t=l.info=NREUM.info;if(t&&t.agent&&t.licenseKey&&t.applicationID&&c&&c.body){l.proto="https"===p.split(":")[0]||t.sslForHttp?"https://":"http://",a("mark",["onload",i()]);var e=c.createElement("script");e.src=l.proto+t.agent,c.body.appendChild(e)}}function r(){"complete"===c.readyState&&o()}function o(){a("mark",["domContent",i()])}function i(){return(new Date).getTime()}var a=t("handle"),u=window,c=u.document,f="addEventListener",s="attachEvent",p=(""+location).split("?")[0],l=e.exports={offset:i(),origin:p,features:{}};c[f]?(c[f]("DOMContentLoaded",o,!1),u[f]("load",n,!1)):(c[s]("onreadystatechange",r),u[s]("onload",n)),a("mark",["firstbyte",i()])},{handle:"D5DuLP"}]},{},["G9z0Bl"]);</script>
   <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">


   <title>Authors</title>






   <meta name="author" content="DesignDiverso" />


   <meta name="description" content="Born from passion. A foundation of entrepreneurial spirit. A curiosity for advancement. The relentless urge to move your brand forward." />



   <meta property="og:url" content="http://www.designdiverso.com/" />
   <meta property="fb:page_id" content="26941908606" />

   <meta property="og:title" content="About Digital Surgeons. Who we are." />



   <meta property="og:description" content="Born from passion. A foundation of entrepreneurial spirit. A curiosity for advancement. The relentless urge to move your brand forward." />


   <meta property="og:image" content="" />


   <meta itemprop="name" content="About DesignDiverso. Who we are." />



   <meta itemprop="description" content="Born from passion. A foundation of entrepreneurial spirit. A curiosity for advancement. The relentless urge to move your brand forward." />


   <meta itemprop="image" content="" />

   <meta name="twitter:card" content="summary" />
   <meta name="twitter:site" content="@designdiverso" />
   <meta name="twitter:site:id" content="0" />

   <meta name="twitter:title" content="Thoughts DesignDiverso. Thoughts." />



   <meta name="twitter:description" content="Born from passion. A foundation of entrepreneurial spirit. A curiosity for advancement. The relentless urge to move your brand forward." />


   <meta name="twitter:image"  content="" />










   <link rel="shortcut icon" href="favicon.png" type="image/x-icon" />

   <link rel="stylesheet" href="dist/css/thoughts.2147483647.css" id="main-styles" />


   <!--[if lt IE 9]>
      <script src="/js/dist/ie8.js"></script>
      <link rel="stylesheet" href="/css/ie8.css" />
   <![endif]-->
</head>

<body>

   <header class="nav-black static" id="primary-nav">
      <div>
         <h1 class="logo"><a href="../index.php">DesignDiverso</a></h1>
         <nav>
            <ul>
            <cms:pages masterpage="menu.php" page_name='main-menu'>
               <li><a  href="work.php"><cms:get "<cms:show my_lang />_menu_content1"/></a></li>
               <li><a href="about.php"><cms:get "<cms:show my_lang />_menu_content2"/></a></li>
               <li><a href="what-we-do.php"><cms:get "<cms:show my_lang />_menu_content3"/></a></li>
               <li><a class="active" href="thoughts.php"><cms:get "<cms:show my_lang />_menu_content4"/></a></li>
               <li><a  href="contact.php"><cms:get "<cms:show my_lang />_menu_content5"/></a></li>
               
               <cms:php>
                        global $accepted_langs, $selected_lang;
                        foreach( $accepted_langs as $lang ){
                        $selected_class = ( $lang==$selected_lang ) ? ' selected' : '';
                        echo'<li><a href="<cms:show k_admin_link />switch.php?lang='.$lang.'&redirect='.urlencode($_SERVER["REQUEST_URI"]).'">'.strtoupper($lang).'</a></li>';
                        }
                        </cms:php>
               
            </ul>
            </cms:pages>
         </nav>
      </div>
      </div>
      <a href="index.php" class="toggle menu"><span class="icon-menu"></span></a>
   </header>

<cms:if k_is_page>

<section class="news-list">
<section class="news-articles">

   <header class="author-header author">
      <div class="photo"><img src="<cms:show author_avtar/>" class="avatar" /></div>
      <div class="info">
           <h2><a href="<cms:show k_page_link />" class=""><cms:show k_page_title /></a></h2>
            <p class="job"><cms:get "<cms:show my_lang/>_author_job"/></p>
            <p><p><cms:get "<cms:show my_lang/>_author_about"/></p></p>
             <ul class="social">
         <li>
            <a href="index.php">
            <span class=""></span>
              </a>
          </li>
          </ul>
      </div>
   </header>
   
<article class="post">
<cms:pages masterpage="thoughts.php" custom_field="en_author=<cms:show k_page_title/>">
   <header class="news-header">
        <a href="<cms:show k_page_link />">
      <img class="thumb" src="<cms:show thoughts_image />" alt=""/>
      </a>
   </header>
    <h1><a href="<cms:show k_page_link />" class=""><cms:show k_page_title /></a></h1>
   <cms:excerptHTML count='25' ignore='img'><cms:get "<cms:show my_lang />_thoughts_content"/></cms:excerptHTML>
   <p><a href="<cms:show k_page_link />" class="btn black"><cms:pages masterpage="menu.php" page_name='main-menu'><cms:get "<cms:show my_lang />_read_button"/></cms:pages></a></p>
    <footer class="news-footer">
        <address class="author-info">
        <a href="authors.php" rel="author" class="author small"><img src="../images/uploads/authors/minime.jpg" /></a>
               <div class="info">
                   <p><cms:get "<cms:show my_lang />_author"/> </p>
               </div>
            <div class="info">
                   <p><cms:if k_page_foldertitle >
               <cms:show k_page_foldertitle />
               </cms:if></p></div>
        </address>

        <div class="article-time">
            <time pubdate datetime="2014-12-24" title="December 24th, 2014"><cms:date k_page_modification_date format='jS M, y' /></time></p>
        </div>
    </footer>

</article>
</cms:pages>

</section></section>
    <nav class="footer-nav-small">
   <cms:set page_name=k_page_name />
<cms:pages>
    <cms:if k_page_name=page_name><cms:set page_count=k_count scope='global' /></cms:if>
</cms:pages>
<cms:pages>
    <cms:if k_count="<cms:sub page_count '1' />"><a href="<cms:show k_page_link />">Previous</a></cms:if>
    <cms:if k_count="<cms:add page_count '1' />"><a href="<cms:show k_page_link />">Next</a></cms:if>
</cms:pages>
   </nav>

<!--------------------------------------------------------------------------------------------------------->

<cms:else />
               
          <cms:pages masterpage='authors.php' paginate='1' limit='5'>        
<section class="news-list">
<section class="news-articles">
<header class="author-header author">
      <div class="photo"><img src="../../../images/uploads/authors/minime.jpg" class="avatar" /></div>
      <div class="info">
           <h2><a href="<cms:show k_page_link />" class=""><cms:show k_page_title /></a></h2>
            <p class="job"><cms:get "<cms:show my_lang/>_author_job"/></p>
            <p><p><cms:get "<cms:show my_lang/>_author_about"/></p></p>
             <ul class="social">
         <li>
            <a href="index.html">
            <span class=""></span>
              </a>
          </li>
          </ul>
      </div>
   </header>
</section></section>
   <cms:if k_paginated_bottom>
    <nav class="footer-nav-small">
      <a href="<cms:show k_paginate_link_prev />" class="left">
         <span class="icon-circle-arrow-left"></span>
         <h5>Next</h5>
        </a>
      <a  href="<cms:show k_paginate_link_next />"class="right">
         <h5>Prev</h5><span class="icon-circle-arrow-right"></span>
      </a>
    </nav>
   </cms:if>
</cms:pages>
</cms:if>

   <footer class="primary-footer">
      <div class="content">
         
         <div class="careers">
         <cms:pages masterpage="menu.php" page_name='main-menu'>
            <p><span class="icon-circle-arrow-right"></span><cms:get "<cms:show my_lang />_footer_content"/> </p>
            </cms:pages>
         </div>
         <div class="social">
            <ul>
               
               <li><a href="https://www.facebook.com/designdiverso" class="icon facebook" target="_blank"><span class="icon-facebook white"></span></a></li>
               <li><a href="https://twitter.com/designdiverso" class="icon twitter" target="_blank"><span class="icon-twitter white"></span></a></li>
               <li><a href="https://www.linkedin.com/company/design-diverso" class="icon linkedin" target="_blank"><span class="icon-linkedin white"></span></a></li>
               <!--<li><a href="http://www.flickr.com/photos/75938667@N08/" class="icon flickr" target="_blank"><span class="icon-flickr white"></span></a></li>-->
            </ul>
         </div>
      </div>
   </footer>

   <!--[if lt IE 8 ]>
   <script src="//ajax.googleapis.com/ajax/libs/chrome-frame/1.0.3/CFInstall.min.js"></script>
   <script>window.attachEvent('onload',function(){CFInstall.check({mode:'overlay'})})</script>
   <![endif]-->

   <!--[if lt IE 10]>
      <script src="/dist/js/polyfill.2147483647.js"></script>
   <![endif]-->





   
   <script src="../dist/js/thoughts-index.1703469738.js"></script>


   

   <script>
     (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
     m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
     })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

     ga('create', 'UA-351280-1', 'designdiverso.com');
     ga('require', 'displayfeatures');
     ga('send', 'pageview');
   </script>

   <script>
      (function(w,d) {
      w.hj = w.hj || function() {(w.hj.q=w.hj.q||[]).push(arguments);};
      w._hjSettings = { hjid: 753 };
      var s = d.createElement('script');
      s.src = '//insights.hotjar.com/static/client/insights.js';
      d.getElementsByTagName('head')[0].appendChild(s);
      }(window,document));
   </script>



<script type="text/javascript">window.NREUM||(NREUM={});NREUM.info={"beacon":"beacon-3.newrelic.com","licenseKey":"bd6f8bf348","applicationID":"3454891","transactionName":"NlVRYhdRCEVZAkMPXg8fcEMWRAlbFxVfCUQGWEdF","queueTime":0,"applicationTime":380,"atts":"GhJSFF9LG0s=","errorBeacon":"bam.nr-data.net","agent":"js-agent.newrelic.com\/nr-476.min.js"}</script>

</body>
</html>

<?php COUCH::invoke(); ?>



KK wrote: I'll assume that the authors.php template is clonable.
From what can be seen on the link you posted, you are linking blog posts to the 'home-view' of authors.php. They should actually be linked to the 'page-view' of authors.php (i.e. a single author cloned page).

Can you please let us know how are the blog posts related to the authors? (I mean, the code you are using to create the relation between the two templates and then fetch the data back e.g. the author related to the a blog-post).
Please see viewtopic.php?p=13433#p13433 for a similar discussion.

As @KK mentioned, the standard way to handle this is to use page relationships. Create a clonable authors template which contains the various author information fields (editable regions). In your blog template, add a relation editable region which defines a one-to-many relationship between your two templates. Please see the page relationships documentation (docs/concepts/relationships.html) for full details.
4 posts Page 1 of 1