We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 364
    • 32 Posts
    I have a craigs list add template made, that i can enter in a product name, price and image. in order to post the page to craigs list i needs the source code for the page. to make it easy for the client to make his craigs list adds.

    is there a way to display the code, or a section of the html code of the webpage inside of itself?. so when he makes a new page with the template. the code in the "display box" is correct for him to copy from.

    I could use any pointers at what direction i should take to get this done.
      • 26903
      • 1,336 Posts
      Hmm, just theorising here but there is a system event named OnWebPageComplete, you could write a plugin to catch this event, get the page content and write it into your textarea above, when the page is shown the content in HTML should be in this text area. You will have to do a bit of filtering because this will be called for every page, maybe you could call your text area something like ’craigstext’ and when the event fires check the content for this name, if present fill in the text area, if not do nothing.
        Use MODx, or the cat gets it!
        • 4041
        • 788 Posts
        Another approach could be to set up your tinymce editor with predefined templates, which are then added to the content area with the click of a button when creating or editing a page.
        Then after the client completes the page(ad) he can use the code button to show the source of the page, then copy/paste that into the craigslist ad space.

        To set up the tinymce editor for predefined templates check here:
        http://modxcms.com/forums/index.php/topic,30069.msg182569.html#msg182569

        With this method, the published page would look exactly like the ad he places.
          xforum
          http://frsbuilders.net (under construction) forum for evolution
          • 364
          • 32 Posts
          Quote from: ganeshXL at Nov 29, 2008, 03:16 PM

          Either replace <> characters with &lt; &gt; etc. (with a texteditor)

          or

          place your html-code in a textarea element:
          <textarea> my html code here... </textarea>

          Though what is inside of the <textarea> my CL ad html code here... </textarea> will change based on what TV’s are entered on page creation. So i dont think this will work.

            • 364
            • 32 Posts
            Quote from: shamblett at Nov 30, 2008, 03:11 AM

            Hmm, just theorising here but there is a system event named OnWebPageComplete, you could write a plugin to catch this event, get the page content and write it into your textarea above, when the page is shown the content in HTML should be in this text area. You will have to do a bit of filtering because this will be called for every page, maybe you could call your text area something like ’craigstext’ and when the event fires check the content for this name, if present fill in the text area, if not do nothing.

            I will take a look at this.

            I was thinking of having something like some code generators i have seen work. where you enter some values or colors, and you get your code, like myspace ect.. Though for the CL ad, just have a text area and a button you can press if need be. that would show the section of code above (cl ad)

            though i think this may require more skill than have. If i find some documentation on this i will look into learning.
              • 364
              • 32 Posts
              Quote from: Breezer at Nov 30, 2008, 06:58 AM

              Another approach could be to set up your tinymce editor with predefined templates, which are then added to the content area with the click of a button when creating or editing a page.
              Then after the client completes the page(ad) he can use the code button to show the source of the page, then copy/paste that into the craigslist ad space.

              To set up the tinymce editor for predefined templates check here:
              http://modxcms.com/forums/index.php/topic,30069.msg182569.html#msg182569

              With this method, the published page would look exactly like the ad he places.

              I think this could work well, and or make things easier to add new product pages to the site from the front end. I will dive more into the link you sent and give it a try.
                • 27330
                • 884 Posts
                I don’t know how it possible, but can be very nice if you could have a text area box that is updated as you type.