We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32645
    • 377 Posts
    I have created several HTML sidebar adverts (divs, images, etc) currently as "Chunks".

    These "sidebar chunks" can appear on one, more or none of the many "templates" seen on the website.

    The problem is, that when I showed the client this - they didn’t understand Chunks/HTML and would prefer to "add, edit and delete" pages, using the WYSIWYG editor to create adverts.

    I can understand why they want this, but I don’t know how to achieve it.

    Has anyone been able to use pages as sidebar adverts, and been able to attatch one, more or none of adverts per template?

    Is there a way to make sidebar adverts much more easier to use/apply?

    In summary;


    + Create a container/folder/page that is a collection of adverts (SIDEBAR ADVERTS) and under it have specific categories (IE: Homepage adverts, About us adverts, etc)
    - Problem: How do you tell a webpage (ie: the "home page") to use specific adverts?
    - Problem: How do you prevent/reduce duplication? There may be a lot of adverts which are the same, in different categories?
      • 4385
      • 372 Posts
      I have used a modified version of the technique from the wiki http://wiki.modxcms.com/index.php/Adding_TV_Widgets_without_hacking_the_core. It worked for me, but I only had one area to update. I made a pulldown in the admin one sidebar for each document.
        DropboxUploader -- Upload files to a Dropbox account.
        DIG -- Dynamic Image Generator
        gus -- Google URL Shortener
        makeQR -- Uses google chart api to make QR codes.
        MODxTweeter -- Update your twitter status on publish.
        • 32645
        • 377 Posts
        As I understand it, you’re solution is to use Template Variables to handle sidebar adverts;

        Lets see if I got this right.

        1. Create a template variable (ie: tv_sidebar_advert) which is a RTE (Rich text editor)
        2. Assign template variable to the document where you want sidebar adverts.
        3. Use snippets to handle empty template variables/content.

        You said you created a drop down of possible adverts to use on the sidebar.

        How did you do this?

        Presumably in a drop-down list you can only ever choose 1 advert. What happens if the user wants to add more than 1?

        Other problems I see in using TV;

        1. Duplication of adverts. Some adverts may be out-of-date, incorrect or inaccurate (ie: if a hyperlink changes in one advert it must change in all the others).

        2. What if the client wants to add more sidebar adverts?

        3. Some documents have either 0, 1 or more adverts, it is not consistent. Therefore, creating a random number of tv_sidebar_adverts (lets say 5) may be too much, or not enough. Can you make an array of Template Variables sidebar adverts?

        I’m willing to use any solution to make sidebar adverts easier to use and hear any ideas you may have on this subject.
          • 7455
          • 2,204 Posts
          why not use ditto with a filter

          we use that a lot
          create a tv called showadverts, make it a checkbox wit this as option: show==yes
          make a template for your advertisements and asaign the tv to that template.
          make a folder with advert documents in there and select the checkbox for those adds you want to show.
          make a chunk for ditto wit the name "ditto_advert_tpl" to use as template that holds the field(s) that you want to use like this (or any way you like to setup your template):
          <div class="advert_ditto">
          <span class="pagetitle_ditto">[+pagetitle+]</span>
          <span class="content_ditto">[+content+]</span>
          <span class="image_ditto">[+imagetv+]</span>
          </div>
          
          

          and then call ditto like this:
          [!Ditto? &parents=`10` &filter=`showadvert,yes,7` &tpl=`ditto_advert_tpl` &total=`4` &summarize=`4`!]

          set the parents to the advert folder and set the number of documents to show(summerize) (4 in this case)

          Or if you do not want the option to select an ad but just place them random you do not need the tv and the call would be like this:

          [!Ditto? &parents=`10` &randomize=`1` &tpl=`ditto_advert_tpl` &total=`all` &summarize=`4`!]

          set the parents to the advert folder and set the number of documents to show(summerize) (4 in this case)
          I hope this works for you

          Greets Dimmy

            follow me on twitter: @dimmy01
            • 32645
            • 377 Posts
            Hi there.

            I’ve found in searching the wiki, I’ve been able to use TV-based chunks (http://wiki.modxcms.com/index.php/Create_TV-Based_Chunks) to create sidebar adverts.

            What it does is it allows you to create checkboxes so the user can pick and choose which adverts to show with regards to the document.

            Whilst these aren’t specifically pages, it does give much more usability than using chunks alone.

            I’m now going to try Dimmy’s solution now as it sounds like it would give the user the ability to use pages, rather than chunks.

            I’ll report back later.
              • 32645
              • 377 Posts
              why not use ditto with a filter

              There is a problem with your solution, and that is - there would be a lot of duplication of adverts. How did you prevent this?
                • 7455
                • 2,204 Posts
                i was thinking the wrong way around
                you like differend adverts on each page?
                I thout all the pages have the same adverts.
                  follow me on twitter: @dimmy01
                  • 32645
                  • 377 Posts
                  In my tests, I’ve concluded the following. It might not make much sense, but I’ve tried my best to simplify my thinking processes;

                  I’ve done 2 tests.

                  Test 1: Use checkboxes to choose an advert per document, as per (http://wiki.modxcms.com/index.php/Create_TV-Based_Chunks)
                  Test 2: Use pages for sidebar adverts per template.

                  Test 1
                  =============================================

                  Use checkboxes. This allows you, per document, to pick and choose what adverts appear in the sidebar for any page.

                  Pros:
                  ---------------------
                  1) Very easy to use. Pick and choose what you want, and its added in the sidebar, regardless of the template.
                  2) Much easier than current system.
                  3) Allows room for much more specific adverts.

                  Cons:
                  ---------------------
                  1) No way to order the adverts.
                  2) You still have to use advanced areas of the website to make the adverts.

                  Test 2
                  =============================================

                  Use pages. This allows you to create pages and use them as sidebar adverts.

                  Pros:
                  ----------------------
                  1) You don’t have to go into advanced areas of the website.
                  2) You can order the adverts.
                  3) You can use the Rich Text Editor (RTE) to write your advert.

                  Cons:
                  ----------------------
                  1) Page-based adverts are generic. You cannot add an advert to a page (ie:about us), you can only add it to a template (homepage template).
                  2) Any adverts for specific pages must be manually created.
                  3) Duplication of adverts. The same advert could appear lots of times under different folders. You will need to make sure that all adverts are up-to-date.


                  Summary
                  =============================================

                  The biggest problem in test 1 is that you can’t order them, and still have to have a good knowledge of HTML in order to use them, but it is the most easiest solution to the problem of adding adverts - plus it works on all pages.

                  The biggest problem in test 2 is that of duplication of adverts, and that it only works on a template, rather than the page.

                  Ideally,

                  1) I’d love to be able to order the adverts in test 1,
                  2) I’d love to be able to reduce/prevent duplication in test 2.

                  Is there a third-way of resolving this?

                    • 32645
                    • 377 Posts
                    I’m currently leaning on the idea of using (http://wiki.modxcms.com/index.php/Create_TV-Based_Chunks), but what I’d like to do is give the user the ability to sort the ordering in addition to choosing the adverts they want to appear.

                    In some ajax demos you can get a list, which you can move elements up and down and it sorts the ordering out. I can’t remember the exact name of this widget, but does MODX have a similar widget to allow the user to sort the ordering of a list?

                    If not, is there another way of sorting chunks that appear in a checkbox list inside a TV as per Create_TV-Based_Chunks?

                    Thanks.