|
There are two issues here it turns out. Yes, the quotes won’t work, and also, I forgot that the entry_id field in exp_channel_titles is an autoincrement but it’s not in exp_channel_data, so exp_channel_data’s entry_id field is getting entered as 0. To get around this problem requires using an embedded template (or a variables addon like Stash) because the second (or rather, third) call of the plugin can’t read the PHP variable due to the parsing order.
So, the first template (set PHP Output) has the following:
{exp:external_entries:insert table="exp_channel_titles" debug="y" } {insert:site_id}1{/insert:site_id} {insert:author_id}1{/insert:channel_id} {insert:channel_id}1{/insert:channel_id} {insert:title}Testing a Simple Place{/insert:title} {insert:url_title}testing_a_simple_place{/insert:url_title} {/exp:external_entries:insert}
{exp:external_entries:select table="exp_channel_titles" debug="n" limit="1" orderby="entry_id" sort="desc" allow_php="yes" } <?php $entry_id = "{select:entry_id}"; ?> {/exp:external_entries:select}
{embed="site/.index-inner" entry_id="<?php echo $entry_id; ?>" }
This is to grab the entry_id and pass it to the inner tempate:
<p>Entry ID: {embed:entry_id}</p>
{exp:external_entries:insert table="exp_channel_data" debug="y" allow_php="yes" } {insert:entry_id}{embed:entry_id}{/insert:entry_id} {insert:site_id}1{/insert:site_id} {insert:channel_id}4{/insert:channel_id} {insert:field_id_18}Hypothetically speaking, this is where my description would go, maybe with "quote" in some places and perhaps a <a href="http://www.hawaii-guide.com">link</a> in others. Does it actually work?{/insert:field_id_18} {/exp:external_entries:insert}
To fix the quotes problem, try inserting the following at line 241 of the plugin;
$insert = str_replace('"', '\"', $insert);
Or
$insert = addslashes($insert);
A bit nasty but it’ll do the trick without removing the links etc. Then you can do a search-and-replace if need be for \”. There must be a better way to do it but I haven’t figured that out yet. Tried heredoc but it didn’t work.
|