We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 46950
    • 86 Posts
    So, I typed some variants of the getResources function to put onto the screen the list of my artcles and they all do work:
    [[!getResources? &tpl=`articleTpl` &parents=`13` &includeContent=`1` ]]
    
    [[!getResources:default=`No results found`? &parents=`13` &tpl=`@INLINE <BR><a href="[[!~[[+id]]]]" title="[[+pagetitle]]">[[+pagetitle]] ([[+id]])</a>`]]
    
    [[!getPage? &element=`getResources` &parents=`13` &tpl=`articleTpl` &limit=`10` &includeTVs=`1`]]
    


    But when I click on the title of any article, I go to the main page of the site. What should I do to make my browser show me a single article?

    This question has been answered by zwhzwh. See the first response.

      • 14214
      • 299 Posts
      What does your template look like?
        • 46950
        • 86 Posts
        Quote from: jisaac at Nov 06, 2014, 08:18 AM
        What does your template look like?
        You mean acticleTpl? Here it is:

        <div class="blogPost"> 
            <div class="date">[[+publishedon:strtotime:date=`%b %d %Y`]]</div> 
            <h2><a href="[[~[[+id]]]]" title="[[+pagetitle]]">[[+longtitle]]</a></h2> 
        
            <p class="author"><strong>Author:</strong> <span class="author">[[+createdby:userinfo=`username`]]</span></p> 
            <p class="summary"><img src="[[+tv.image:phpthumbof=`w=100`]]">  [[+introtext]]</p> 
            <p class="readmore"><a href="[[~[[+id]]]]"><span>Read more</span></a></p> 
        
            <div class="clear">[[+content:ellipsis=`350`]]</div> 
        </div> 
        <hr/> 
        
          • 46950
          • 86 Posts
          Hmm.... It seems to me that this articleTpt describes rather every acticle in the list created with getResources and getPage... (the 1st and the 3rd line in my initial example).
            • 14214
            • 299 Posts
            Try creating a new template with just the page title and content placeholder. If this works then you can take steps to create a new template.
              • 46950
              • 86 Posts
              So, in this command
              [[!getResources? &tpl=`articleTpl` &parents=`13` &includeContent=`1` ]]

              the parameter &tpl describes how every article will look in the list, right? But where should I describe what a single article must look like? (I mean, after clicking on its header in the list)
                • 14214
                • 299 Posts
                In the document/article template. getResources aggregates the document and its elements for display in one location or as a list. If you click on a link <a href="[[~[[+id]]]]">[[+pagetitle]]</a> you will be brought to the resource/document and all control over its output is on the template select when editing the document.
                  • 46950
                  • 86 Posts
                  Quote from: jisaac at Nov 06, 2014, 08:51 AM
                  In the document/article template. getResources aggregates the document and its elements for display in one location or as a list. If you click on a link <a href="[[~[[+id]]]]">[[+pagetitle]]</a> you will be brought to the resource/document and all control over its output is on the template select when editing the document.
                  Sorry, I still cannot understand where this template for the resource/document is described.
                    • 14214
                    • 299 Posts
                    It is not controlled in the getResources call. It is controlled in the editor where you create/edit the content of the resource.

                    To change the template or a resource, click on a resource in the resource tree and the dropdown for selecting a template will be on the right below the save/close/duplicate buttons.
                      • 14214
                      • 299 Posts