3

I'm working on a large site and one of the sections I'm about to develop has 170 entries, all of them use the same long copy, except for one single word. For example:

Entry 1: All of our experts are native Afar speakers and professionally qualified bla, bla, bla.

Entry 2: All of our experts are native Afrikaans speakers and professionally qualified bla, bla, bla.

Every entry has to be dynamically created because at some point they will be translated into another language (using Publisher for this).

Is there a way to setup a system without having the client to enter manually every entry in the ExpressionEngine publish window?

It is the same text always with only one word changing and it feels like too much work copying and pasting 170 times.

What would be the best approach to develop this?

3
  • So really your question is not how to create the 170 entries automatically, but rather how to create one entry with a dynamic bit in the middle of a sentence? That one entry will then be translated multiple times via Publisher and the dynamic part needs to be automatically mapped to the correct translated phrase. Dec 7, 2012 at 19:07
  • Yep, thanks for making the question much much clearer! Dec 8, 2012 at 10:31
  • I know this doesn't answer your question but I'd be careful that you don't get hit with duplicate content penalties from Google with what you're doing.
    – Tyssen
    Dec 13, 2012 at 13:06

2 Answers 2

4

You could generate XML with EE templates and import it with an add-on like DataGrab.

Create a template group xml_import and the templates xml_import/entries and xml_import/entry. Set both template types to XML.

xml_import/entries:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<entries>
    {embed="xml_import/entry" language="Afar"}
    {embed="xml_import/entry" language="Afrikaans"}
</entries>

xml_import/entry:

<entry>
    <title>{embed:language}</title>
    <content>
    <![CDATA[
      <p>All of our experts are native {embed:language} speakers and professionally qualified bla, bla, bla.</p>
    ]]>
    </content>
</entry>

In the entries template add {embed="xml_import/entry" language="Afar"} for every language.

In the entry template you can edit the title, content or other fields. {embed:language} outputs the language name.

Check you XML document http://yourdomain.com/xml_import/entries.

I have not used DataGrab for myself but I believe it shouldn’t be hard to import the generated XML document and its data into new entries.

Of course you can generate CSV, RSS or other document types this way. The principle is identical.

1
  • This would be the first time I try an XML approach to EE entries. Thank you, Dennis, for all the detail. It looks like it should work. Dec 8, 2012 at 10:30
1

Why not just wrap the output in a find and replace addon such as LowReplace or any of the others found here: http://devot-ee.com/search/results?keywords=find+and+replace&collection=addons&addon_version_support=ee2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.