reuse content on different domains

  • Hi there, I just wondering if can I reuse content (e.g. news articles) from a mainsite.com to site_A.com, site_B.com and site_C.com, of course, all of them using Perch; my idea is to publish news on mainsite.com and automatically publish on the other sites; is it possible to do this? I've tried to to do this using an RSS feed but I can't set up an image for each article and even worst, I can't set up a css style for the xml. Thanks

  • drewm

    Approved the thread.
  • There's probably three parts to this:


    1. Produce the JSON feeds on your primary site

    2. Write code (probably an app) to parse and use the JSON on the secondary sites

    3. Figure out how/when those feeds should be refreshed (possibly a scheduled task)


    For an experienced PHP developer this should be very straightforward, so it'll depend on your level of experience.

  • Hi Drew.


    Thank you for your answer. I'm not an experienced PHP developer, so, I've been traying to do this using a XML feed.


    My code for rss_post.html

    Code
    1. <item>
    2. <title><perch:blog id="postTitle" /></title>
    3. <link><perch:blog id="domain" /><perch:blog id="postURL" /></link>
    4. <guid><perch:blog id="domain" /><perch:blog id="postURL" /></guid>
    5. <description><![CDATA[<perch:blog id="excerpt" encode="false" />]]></description>
    6. <pubDate><perch:blog id="postDateTime" format="D, d M Y H:i:s O" /></pubDate>
    7. <enclosure url="https://mysite.com<perch:blog id="image" type="image" crop />" length="123456789" type="image/jpeg" />
    8. </item>

    My feed rss.php on my news folder

    my page to show rss feed


    My problem is that I can't see post image on <item>. I've used

    Code
    1. length="123456789"

    on <enclosure> because I don't know how can I obtain this value.


    Thanks for your help.

  • I’m not quite sure what you’re asking. Is the image path not being output into the template? If not, what do you get, and what does that field look like in your post.html template? Do the attributes match?

  • Hi Drew, Thank you for your answer. My issue is: I can't see the blog image ("image") on my page to show rss feed. Path to the image is ok.


    post.html

  • Yes, I'm trying other way, here you go

  • Ok, I did a change but still not working

  • Here's my updated rss_post.html template:

    Code
    1. <item>
    2. <title><perch:blog id="postTitle" /></title>
    3. <link><perch:blog id="postURL" /></link>
    4. <guid><perch:blog id="domain" /><perch:blog id="postURL" /></guid>
    5. <description><![CDATA[<perch:blog id="excerpt" encode="false" />]]></description>
    6. <pubDate><perch:blog id="postDateTime" format="D, d M Y H:i:s O" /></pubDate>
    7. <img src="https://patagonia.uach.cl<perch:blog id="image" type="image" width="100" height="75" crop="true"/>" />
    8. </item>