We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7527
    • 437 Posts
    Good morning. I have created and Archives page on my site which renders the archive folders fine, the issue comes when the folder is clicked. It takes the user to the correct landing page but it breaks the template for some reason. I have it set as a specific 'Archive' template but it pulls in the 'home' template? Just after a bit of advice as to where I need to look to fix this as I am a little bamboozled.

    My call on my landing page is :

    [[!getPage? &element=`getArchives` &elementClass=`modSnippet` &tpl=`Pfwarchiveblog` &includeContent=`1` &hideContainers=`1` &parents=`39` &showHidden=`1` &pageVarKey=`tags` &includeTVs=`1` &toPlaceholder=`archives` &cache=`0` ]]
    News for the period [[+arc_month_name]] [[+arc_year]]
    
    [[+archives]]
    [[!+page.nav]]


    And my Pfwarchiveblog tpl has the following code:

    <div class="post-top">
    <div class="post-date">[[+date]]</div>
    
    <h4><a title="Permanent Link to [[+pagetitle]]" href="[[~[[+id]]]]" rel="bookmark">[[+pagetitle]]</a></h4>
    </div>
    <div class="entry"><a href="[[~[[+id]]]]"><img class="alignleft" title="[[+tv.news_image_title]]" src="[[+tv.news_image]]" alt="" width="240" height="155" /></a> [[+content:ellipsis=`150`]] <a class="more-link" href="[[~[[+id]]]]">Read the rest of this entry »</a></div><br>


    I can play with the Divs and tpl once I can load the landing page, but I can't understand why it is overriding the template?

    Here is the link page:

    www.pawsforwildlife.co.uk/archives.html

    Thank you

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

      www.PawsForWildlife.co.uk
      www.Borntobrick.co.uk
    • discuss.answer
      • 13226
      • 953 Posts
      Before you continue may I suggest you deal with the other problems first - e.g Adv.Search

      I see you still have the CSS and Javascript in the head

      You don't have the "base href" tag in any of your templates - you need it in there, you have nested pages which aren't displayed correctly simply because the CSS and javascript files can't be found (due to no base href)

      Check your pages in the HTML validator - you have tons of errors
        • 7527
        • 437 Posts
        Sorry in my haste I ammeded the AvSearch call instead of the AdvSearchForm snippet. I have been checking HTML validator and will target each error as I go. I think I got a little too eager to finish my templates! Thank you for pointing out the issues
          www.PawsForWildlife.co.uk
          www.Borntobrick.co.uk
          • 13226
          • 953 Posts
          Ah, OK

          I suggest step for step - jumping from one element to another will probably cause confusion and that's when mistakes start to crop up.

          I personally create one template with all of its features and then go to the next, 1 at a time
            • 7527
            • 437 Posts
            I have now copied the base href to all templates (pointing to the site URL). Although I have amended the AdvSearch as suggested it still shows in my header...the W3C Validator has pointed out many silly mistakes which I am correcting, I stupidly thought of creating the template and then looking to validate after whereas I now realise I should validate as I go!
              www.PawsForWildlife.co.uk
              www.Borntobrick.co.uk