ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

news ticker

October 26, 2007 2:11pm

Subscribe [2]
  • #1 / Oct 26, 2007 2:11pm

    socaprice

    217 posts

    Hi all,

    I have just purchased a news ticker software program from Amara Software. The program has the capability of reading from an XML file.

    Can someone tell me how to pass my weblog entries, any one of them, whether it is the title, summary or body tag, to an XML file to be read by the news ticker?

    The program allows me to have links so I will then have to link to the blog entry, once I click on it in the ticker.

    Any help would be appreciated.

    Thanks,
    Socaprice

  • #2 / Oct 27, 2007 2:28pm

    grantmx

    1439 posts

    Here is something really, really basic to get you started.  Create a custom XML template in any template group and do something similar to this:  Note - I don’t know your actual XML that is required.

    <?xml version="1.0" encoding="UTF-8"?>
    <news>
        <section>
    {exp:weblog:entries weblog="your_weblog" limit="5"}
            <title>{title}</title>
            <summary>{summary}</summary>
            <link>{custom_link_field}</link>
    {/exp:weblog:entries}
        </section>
    </news>

    You can also create custom fields and have them included.  If using links, make sure you modify your weblog posting preferences in Admin ›  Weblog Administration ›  Weblog Management ›  Edit Weblog to not Automatically turn URLs and email addresses into links.

  • #3 / Oct 28, 2007 10:42am

    socaprice

    217 posts

    Here is something really, really basic to get you started.  Create a custom XML template in any template group and do something similar to this:  Note - I don’t know your actual XML that is required.

    <?xml version="1.0" encoding="UTF-8"?>
    <news>
        <section>
    {exp:weblog:entries weblog="your_weblog" limit="5"}
            <title>{title}</title>
            <summary>{summary}</summary>
            <link>{custom_link_field}</link>
    {/exp:weblog:entries}
        </section>
    </news>

    You can also create custom fields and have them included.  If using links, make sure you modify your weblog posting preferences in Admin ›  Weblog Administration ›  Weblog Management ›  Edit Weblog to not Automatically turn URLs and email addresses into links.

    That looks good. Now the Amara software people tell me their product will not work with EE because the XML file has to be in their format. Their format is shown below:

    <item license=“Don’t remove this paragraph, or your template will stop working. Amara Software owns the copyright to this template, which may not be sold or resold, in its original form or as part of another template, by anyone other than Amara Software. To check the full license restrictions, please refer to http://www.amarasoftware.com/ntlicense.html.”&gt;
          <itemlink=”” target-frame=“_self” font-face=“Arial” font-size=“12” font-color=“16777215” higlight-color=“12632256”>
          <![CDATA[Welcome to Amara News Ticker allows you to create Flash news tickers instantly.]]>
      </item>
    <itemlink=”” target-frame=“_self” font-face=“Arial” font-size=“12” font-color=“16777215” higlight-color=“12632256”>
          <![CDATA[Amara News Ticker blah blah blah.]]>
      </item>
    </item>

    I am not in the office as yet so I cannot test this until tomorrow in EE, however I was able to test the template by changing item to section and adding the XML encoding at the beginning and that did not screw up the ticker but from your sample do you think this will work? shown below:

    <?xml version=“1.0” encoding=“UTF-8”?>

    <news license=“Don’t remove this paragraph, or your template will stop working. Amara Software owns the copyright to this template, which may not be sold or resold, in its original form or as part of another template, by anyone other than Amara Software. To check the full license restrictions, please refer to http://www.amarasoftware.com/ntlicense.html.”&gt;
      <section link=”” target-frame=“_self” font-face=“Arial” font-size=“12” font-color=“14737632” higlight-color=“12632256”>
      {exp:weblog:entries weblog="your_weblog" limit="5"}
          <![CDATA[{title}\n{summary}]]>
      {/exp:weblog:entries}
      </section>
    </news>

    Thanks for all your help. I may only find out via trial and error so thanks for giving me a start.

    Regards,
    Socaprice

  • #4 / Oct 28, 2007 11:20am

    grantmx

    1439 posts

    I dont see why it wont. Just make sure your template type is XML.  Also, in your HTML code or however the software sees the XML, point to the XML file like this:

    <!--if you have removed index.php from your url-->
    <a href="http://yoursite.com/template_group/xml_tempalte">http://yoursite.com/template_group/xml_tempalte</a>
    
    <!--if you have not removed index.php from your url-->
    <a href="http://yoursite.com/index.php?/template_group/xml_tempalte">http://yoursite.com/index.php?/template_group/xml_tempalte</a>

    In other words, no need to put “.xml”

  • #5 / Oct 28, 2007 10:25pm

    socaprice

    217 posts

    Thanks. I have not tried it out fully on EE at my office but I tried running the Amara software flash file on my home pc but let it point to my blog’s XML file on the internet and what is shown below seems to work:

    <?xml version=“1.0” encoding=“UTF-8”?>

    <news license=“Don’t remove this paragraph, or your template will stop working. Amara Software owns the copyright to this template, which may not be sold or resold, in its original form or as part of another template, by anyone other than Amara Software. To check the full license restrictions, please refer to http://www.amarasoftware.com/ntlicense.html.”&gt;
      <section link=”” target-frame=“_self” font-face=“Arial” font-size=“12” font-color=“14737632” higlight-color=“12632256”>
          <![CDATA[{exp:weblog:entries weblog="pinkatlas" limit="1"}{title}

    {summary}{/exp:weblog:entries}]]>
      </section>
    </news>

    I am able to see the values of the {title} and {summary} in my news ticker. I still have a lot of tweaking to go cause I cannot seem to put links in the code so that when they click on an item it takes them to the blog entry. Plus, I have been looking at the blog entry parameters to see if I can pick which blog to display in the news ticker and I have not figured it out as yet, but at least I am crawling before I start walking and then running. Also, I am learning something new every time.

    Thanks, I will keep poking around and trying different things.
    Socaprice

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases