We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29703
    • 217 Posts
    Hi All,

    I thought I’d post my questions here as the Modx community seem a lot more clued up than any other forums I’m a regular in.

    I’m starting a project in ModX over the next few months and I was just wondering about the feasability. I’m looking at creating a web app for writing articles that users could then include in their blog seamlessly. In essence they would be embedding the content from my server though the article would be styled with their stylesheet.

    A quick pointer as to how/if this can be achieved would be great.

    Oh and on a side note, if anyone is proficient at using Ajax with Modx I’ll be looking for someone to help out soon (paid of course).

    Thanks,

    Henry
      • 23515
      • 40 Posts
      Interesting idea! you could have each story then an "embed" button which links to a page that contains a ditto snippet which gets the content and title of that page, but just spits it out as some basic html (assuming <p>s and <h1>s etc). Although getting it to be styled using their style sheet maybe tricky, as there is no standard way for laying out content.

      For example some people may us a h2 as the page title, h1 being the site title, where some people might infact use h1, or even h3. Some people may also have starter paragraphs, which have a class assigned etc. I guess if you’re appealing to a community that all uses the same layout then it could be easier, but any customisation at all might cause issues.

      EDIT: just seen the words "from my server". Meaning that if you changed a line of text on your article, it would change on all the places it was embedded? That would require something completely different than the above...
        • 29703
        • 217 Posts
        Quote from: pixsaul at Jul 29, 2009, 10:19 AM

        For example some people may us a h2 as the page title, h1 being the site title, where some people might infact use h1, or even h3. Some people may also have starter paragraphs, which have a class assigned etc. I guess if you’re appealing to a community that all uses the same layout then it could be easier, but any customisation at all might cause issues.

        Actually yes you have a good point. I wonder if it would be possible to have a preview mode that grabs the css from an entered url, that way they’d be able to make sure the formatting follows the theme of the site. Regarding opening paragraphs having separate classes, I guess there would need to be some raw editing options for advanced users.

        Quote from: pixsaul at Jul 29, 2009, 10:19 AM

        EDIT: just seen the words "from my server". Meaning that if you changed a line of text on your article, it would change on all the places it was embedded? That would require something completely different than the above...

        Yeah this is the biggy really. I’ve been looking at loading XML files via Ajax but I would rather the pages got indexed with the content, else it renders it rather useless. PHP includes would be ideal I guess though I don’t know how they behave cross-servers...

        edit -> I just discovered this:

        <?php
        $somevariable = file_get_contents("http://www.abcsite.com/somefile.ext");
        echo ($somevariable);
        ?>
        


        Works a treat!