We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4080
    • 139 Posts
    It is! But it’s not readily apparent. There’s a search box in the TinyMCE Insert/Edit link dialog box. Peep this screenshot! It’s pretty dang handy actually but I kinda wish it was coupled with a pull down menu. I’m assumption is that if this was the case, showing hundreds (or even more) resources in the pull-down menu could probably bring a browser down. So with this in mind, the search aspect is pretty slick. A arrow "drag/point to" like Dreamweaver has would be super sweet too. I’m sure that’s not an easy task.
      • 1841
      • 141 Posts
      This is great, I had managed to use something very similar myself but I wanted the output to be a link, with the resource pagetitle as the anchor text. The only way I have managed to achieve this though is using the GetField snippet, it works well though.

      Here is the input option for the TV (Input type DropDown List Menu), it’s just about the same as the code above:

      @SELECT pagetitle AS Column1,id FROM [+PREFIX+]site_content WHERE parent='2811' ORDER BY pagetitle


      And I then used the following in my template to output as a link with the relevant anchor text:

      <a href="[~[*mytv*]~]">[!GetField? &docid=`[*mytv*]` &field=`pagetitle`!]</a>


      Anyone see an easier way of doing this (ie not having to use GetField), then let me know.

        • 35994
        • 2 Posts
        Hi
        I’m new and a total novice.
        I have a website which was built and just had modx cms built into it. I’m having a play around as I want to be able to completely manage my own website and learn a few new things in the process. I am by no means a web designer so go easy on me!

        I’ve used the OP’s code for creating a variable template drop down list which has been created fine but what I cant seem to get is how to then incorporate this dropdown list variable template into the actual template so that it works if that makes sense?

        Anyone help?

          • 4080
          • 139 Posts
          You’re in the right place for people "going easy on ya". In fact I have yet to find any pretension in the MODX community. Everyone’s very nice and very helpful. Could you post some of the code in question so we can get some more context and hopefully help? smiley
            • 35994
            • 2 Posts
            Hi Brian,

            Thanks for replying.

            Screenshot couple of screenshots attached.
            This is the code from the page template i want to add the drop down menu to


            <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
            <html xmlns="http://www.w3.org/1999/xhtml">
            <head>
            <title>[(site_name)] | [*pagetitle*]</title>
            <base href="[(site_url)]" />
            <meta http-equiv="Content-Type" content="text/html; charset=[(modx_charset)]" />
            <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
            <link rel="SHORTCUT ICON" href="http://www.rwsdatainstallations.co.uk/favicon.ico"/>
            <link rel="stylesheet" type="text/css" href="assets/rws/css/style.css" />
            <link rel="stylesheet" type="text/css" href="assets/rws/css/reset.css" />
            <link rel="stylesheet" type="text/css" href="assets/rws/css/jquery.lightbox-0.5.css.htm" media="screen" />

            <script type="text/javascript" src="assets/rws/js/jquery-1.2.6.js"></script>
            <script type="text/javascript" src="assets/rws/js/jquery.cycle.all.min.js"></script>
            <script type="text/javascript" src="assets/rws/js/jquery.easing.1.1.1.js"></script>
            <script type="text/javascript" src="assets/rws/js/script.js"></script>
            <script type="text/javascript" src="assets/rws/js/jquery.lightbox-0.5.js"></script>



            <!--[if IE 6]>
            <link rel="stylesheet" href="assets/rws/css/ie6.css" type="text/css" media="screen" />
            <script type=’text/javascript’ src=’assets/rws/js/dd_belated_png.js’></script>
            <script>DD_belatedPNG.fix(’#main_slider_con,.png,.featured_box_icon,.box2_top,.box_top,.box2_bottom,.box_bottom,#search,.slider_buttons,#pages_slider_con’);</script>
            <![endif]-->


            <script type="text/javascript">
            $(function() {
            $(’a.l_box’).lightBox();
            });
            </script>
            </head>

            <body>

            <div id="con0" align="center">
            <div id="con1">
            <div id="header">
            <!-- logo -->
            <div id="logo2"><a href="http://www.rwsdatainstallations.co.uk/" title=""><img src="assets/rws/images/logo2.png" alt="R W S Data Installations" class="png" /></a></div>
            <!-- /logo -->

            </div>
            </div>


            <div id="pages_slider_con">

            {{navigation}}

            <!-- title area -->
            <div id="title_area">
            <div class="title_area_style_1">
            <h1>[*longtitle*]</h1>
            </div>
            </div>
            <!-- /title area -->
            </div>


            <!-- content area-->
            <div id="content_con">

            <div class="box_in"></div>
            <div class="box2_top"></div>
            <div class="box2_content">


            <!-- left side-->

            <div id="page_left">

            <div id="sub_nav"><a href="">Home</a> \ [*pagetitle*]</div>
            <div class="f_box4_hr"><img src="assets/rws/images/pixel.gif" alt="" /></div>

            <div class="content">
            [*content*]



            </div>
            </div>

            <!-- / left side -->



            <!-- right side -->
            <div id="page_right_cont">

            <div class="page_right">
            <div class="page_right_2"></div>
            <div class="right_box">
            {{submenu}}

            </div>
            <div class="page_right_3"></div>
            </div>
            <div class="page_right">
            <div class="page_right_2"></div>

            {{testimonials}}
            <div class="box_r"></div>
            <div class="page_right_3"></div>
            </div>
            <!-- / box 2 -->
            </div>
            <!-- / right side -->


            <div style="clear:both;"></div>
            </div>
            <div class="box2_bottom"> </div>
            </div>
            <!-- /content area-->



            <div class="box_in"></div>

            {{footer}}

            Hope you can help me

            :)
              • 4080
              • 139 Posts
              I THINK you might be looking for a different solution. Do you need something other than a drop down of resources in your TV? Are you looking to be able to add that entire piece of HTML through using a TV? Sorry, still confused here. Hope to help!
                • 35764
                • 35 Posts
                my drop-down list is working well but it is also showing deleted resources, is there any way to prevent this?

                Thank you

                Lisa
                  • 4080
                  • 139 Posts
                  Hmm. Weird. I think because this seems to me to be a "hack" of sorts you may actually have to purge the deleted resources in the resource tree. Fortunately with Revo you don’t have to deal with this as it’s built in.
                    • 5340
                    • 1,624 Posts
                    You should probably add more conditions to the sql query:

                    @SELECT pagetitle AS Column1,id FROM [+PREFIX+]site_content WHERE parent=’2811’ AND published=’1’ AND deleted=’0’ ORDER BY pagetitle
                      • 35764
                      • 35 Posts
                      thank you for your help.

                      I have another question. When I see the drop-down list I can see the page titles as desired but the output in the preview only shows the resource id.

                      What I would like is to be able to see the page title which then links to the relevant resource.

                      For example, user creates a product page and selects a category from the tv dropdown list. When the page is viewed in a browser the browser displays the category and links to the relevant page. The link works fine its just that its showing the resource id and not the pagetitle.

                      Hope that makes sense.

                      Thanks

                      Lisa