We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 53362
    • 26 Posts
    Hello

    Can anyone help with the following please?

    We have an inherited modx site http://www.restauranttwenty2.co.uk/

    It has a Featured items panel that appears on all the pages. For some reason although the template code [[$featured-items-panel]] is the same in both the home and the basic page template it displays differently on the home page than on all others on the front end.

    I can see where to edit the code for the Featured items panel items that are appearing on all but the home page but not for the one that is on the home page.

    I would like to add the panel from the home page to the other pages and be able find where to edit it.

    Any help or advice appreciated.

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

      • 3749
      • 24,544 Posts
      What does your featured-items-panel chunk look like?
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 46886
        • 1,154 Posts
        Ok I think the 'featured' part you are talking about is at the bottom of every page, is that right? I notice they are getting cut off, the picture isn't showing properly.

        Now I notice that the content is also not the same for these...perhaps this isn't the part you are concerned about?

        If it is, then you seem to have two different tools pushing information out. The inside pages have dummy content (fake latin) and different titles.

        When finding where a tool is placed, you have to run through the whole process. Its a pain but Modx allows the developer to do things really in any way they want.

        The 'front' page is only chosen by your system settings, it can be any page. When you are looking at a page and want to work backwards here's the process:

        template (and any chunks)>resource (this is the 'page' itself which could be blank if the template contains all code)>snippets attached to page/template

        If you've got similar page layout and different behavior, its possibly a different template. If the tool itself is the same...but I don't see how it can be in this case.

        This could be something as simple and a css class not getting pulled in, and in a pinch you can simply hard-code it to do what you need.

        But given the behavior, I would take a look around and see where all the parts are.
          • 3749
          • 24,544 Posts
          The reason I asked to see the featured-items-panel chunk is that it may contain a snippet tag for a snippet that generates the content you're concerned about. That snippet may have code that does something different if it's the home page.

          Another possibility is that the chunk refers to a Template Variable that may contain a different value on the home page.

          Seeing the content of the chunk should tell us what's going on.

            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting
            • 53362
            • 26 Posts
            Hello

            Many thanks to both of you for taking the time to reply.

            I have attached a screen shot showing the featured-items-panel from the layout section.
            The individual parts of this are in the chunks section and when edited the changes are reflected in the frontend of the site.

            The same section on the home page though I just can't find anywhere, apologies I must be missing something as I am not very familar with modx. I can't see why these are different?

            Below are the contents of the two templates being used if that helps.

            Thanks again for you time it is appreciated.

            David

            Basic Page Template Content

            <!DOCTYPE html>
            <html lang="en-gb" dir="ltr">

            [[$html-head]]

            <body>

            [[$site-header]]

            [[$page-heading]]

            <section id="tm-main">
            <div class="uk-container uk-container-center">
            <div class="uk-grid">

            <div class="tm-content uk-width-medium-2-3 uk-animation-scale-up">
            [[*article-image:notempty=`<div class="tm-event-media uk-align-left"><img src="[[*article-image:phpThumbOf=`w=297&q=90`]]" alt="[[+pagetitle]]" class="uk-margin-top" /></div>`]]
            [[*content]]
            </div>

            <aside class="tm-sidebar uk-width-medium-1-3">
            [[$sidebar-sub-nav-menu]]
            [[*show-booking-form:is=`1`:then=`[[$sidebar-booking-form]]`]]
            </aside>
            </div>
            </div>
            </section>

            [[$featured-items-panel]]

            [[$footer]]

            [[$nav-offcanvas]]

            </body>

            </html>


            Home page template

            <!DOCTYPE html>
            <html lang="en-gb" dir="ltr">

            [[$html-head]]

            <body>

            [[$home-full-screen]]

            <section id="tm-main">
            <div class="uk-container uk-container-center">
            <div class="uk-grid">
            <div class="tm-content uk-width-medium-2-3">
            <h2>[[*pagetitle]]</h2>
            [[*content]]
            </div>
            <aside class="tm-sidebar uk-width-medium-1-3">
            [[$sidebar-booking-form]]
            </aside>
            </div>
            </div>
            </section>

            [[$featured-items-panel]]

            [[$footer]]

            [[$nav-offcanvas]]

            </body>

            </html>
              • 46886
              • 1,154 Posts
              Ok that is very orderly code, that's for sure.

              Can you also drill down and give us the contents of the three chunks, [[$next-event-panel]] and the other two. The ones in the picture you uploaded. Those could be important, in there it could be a tool to grab the right data.

              Also, please go to the resource of the front page and check below the content space for any grids, actually do that for that one and any random inside page. The call to the front page content is there so you should see some of the text from the middle area (hello gorgeous...)

              You are looking for some content laid out, possibly a picture and some text. It might only be in the front page...

              Basically, it looks like the job wasn't finished, because the content is dummy on the inside pages. But on the front page everything is different. So a tv with different titles is possibly what we have here.

                • 53362
                • 26 Posts
                Hello

                Many thanks for your reply and help.

                The code for the three chunks is below. When editing the text in these the changes are reflected in the frontend of the site on all pages with basic page template:

                next-event-panel

                <div class="uk-width-medium-1-3">
                <div class="uk-panel uk-panel-box">
                [[!getResources? &parents=`4` &tpl=`news-panel-item` &includeContent=`1` &includeTVs=`1` &processTVs=`1` &limit=`1` &toPlaceholder=`next-event`]]
                [[+next-event:empty=`<h3 class="uk-panel-title">Special Events at Twenty Two</h3>
                <div class='tm-panel-text'>
                <p>E ita dolore minim quae, mandaremus lorem elit quibusdam lorem. Et singulis ut aliquip,magna qui ita quorum nescius.</p>
                </div>
                <div class="tm-panel-image">
                <img src="assets/images/img_3.jpg" alt="our next event" />
                </div>`]]

                </div>


                featured-dish-panel

                <div class="uk-width-medium-1-3">
                <div class="uk-panel uk-panel-box">
                [[!getResources? &parents=`21` &tpl=`news-panel-item` &includeContent=`1` &includeTVs=`1` &processTVs=`1` &limit=`1` &toPlaceholder=`latest-news` &tvFilters=`article-type==featured-dish`]]
                [[+latest-news:empty=`<h3 class="uk-panel-title">This Month's Featured Dishes</h3>
                <div class='tm-panel-text'>
                <p>E ita dolore minim quae, mandaremus lorem elit quibusdam lorem. Et singulis ut aliquip,magna qui ita quorum nescius.</p>
                </div>
                <div class="tm-panel-image">
                <img src="assets/images/img_1.jpg" alt="our next event" />
                </div>`]]

                </div>
                </div>


                latest-news-panel

                <div class="uk-width-medium-1-3">
                <div class="uk-panel uk-panel-box">
                [[!getResources? &parents=`21` &tpl=`news-panel-item` &includeContent=`1` &includeTVs=`1` &processTVs=`1` &limit=`1` &toPlaceholder=`latest-news` &tvFilters=`article-type==latest-news`]]
                [[+latest-news:empty=`<h3 class="uk-panel-title">News from Twenty Two</h3>
                <div class='tm-panel-text'>
                <p>E ita dolore minim quae, mandaremus lorem elit quibusdam lorem. Et singulis ut aliquip,magna qui ita quorum nescius.</p>
                </div>
                <div class="tm-panel-image">
                <img src="assets/images/img_3.jpg" alt="our next event" />
                </div>`]]

                </div

                I have also attached the screen shot for the home resources but can not see a grid.

                Must be there somewhere I guess....

                Thanks very much again for your time.

                David [ed. note: lemondrop last edited this post 7 years, 10 months ago.]
                  • 3749
                  • 24,544 Posts
                  That's everything except the chunk I asked to see -- the featured-items-panel chunk. wink
                    Did I help you? Buy me a beer
                    Get my Book: MODX:The Official Guide
                    MODX info for everyone: http://bobsguides.com/modx.html
                    My MODX Extras
                    Bob's Guides is now hosted at A2 MODX Hosting
                    • 53362
                    • 26 Posts
                    Sorry I must have got it mixed up.

                    Thanks for your reply, Is the part you wanted to see in the attached screenshot?

                    Many thanks again for your time.

                    David
                      • 46886
                      • 1,154 Posts
                      Bob its in the picture attached above. It just has three chunks basically. For now can we not worry about the front page, which seems ok even if it can't be found. We can find that later for sure.

                      Ok I think I see what is going on, at least a little bit. The tools are in those chunks.

                      In this case what you are getting on those pages is default text, as the parent resource is empty. Here is the code where this happens:

                      [[+latest-news:empty=`this default content will show if empty'


                      The tool is getResources, so let's talk about how it gets the info. Basically you should look for the parent resource (4 for the first one, 21 for the second two which needs fixing, they should each be different).

                      Try this: Make a new resource and place it in resource 4 (ID number of resource). This new page will be your content about your new (dummy) event. Publish it too.

                      That should make it visible in the tool and it should output on the page, no more latin. For each new event, write it up in a new resource, drag and drop into the parent resource (which can be a container and/or have its own content), and publish.

                      Because you have the same parent resource for the second two tools (getResource calls), they will be identical, so you will want to make a new resource and change the 21 to that resource number. Then you will have three folders and the tools will always dynamically go get...hmmm some content let's see...I suppose it will be the latest item (its limited to one) but not positive now.

                      So, give it a try and let us know!

                      PS I still don't know why the front page is getting different contents...