String
ExpressionEngine 1.x, ExpressionEngine 2
Back to this add-on's main page
View Other Add-ons From eMarketSouth
String with P&T Matrix (Need help)
Support Request
Kippi
|
Posted: 26 September 2012 05:10 PM |
|
|
|
Hi,
I have a matrix field called “embedded_images” with three columns:
1) image (this first column is a “copee pastee” cell type, enabling me to copy and paste “image_1”, “image_2”, etc into the “summary” field.
2) image_upload
3) image_text
Im trying to use String to place an image in an entry and can successfully do this but when I add the “image_text” tag neither the image or the “image_text” appears.
My code looks like this:
{exp:channel:entries channel="news"}
{embedded_images} {exp:string:set name="image_{row_count}"} <img src="{image_upload}"> {image_text} {/exp:string:set} {/embedded_images}
{exp:string:output} {summary} {/exp:string:output}
{/exp:channel:entries}
Any help with this would be appreciated.
Thanks
|
|
|
eMarketSouth
|
Posted: 27 September 2012 09:29 AM |
# 1
|
|
Developer
|
Hello Kippi,
I’m not sure I understand your code fragment, it looks like something is missing. Should there be a {exp:string:append name=“summary”} tag pair inside the {embedded_images} tag pair?
Sincerely,
Jack Scott
|
|
|
Kippi
|
Posted: 27 September 2012 10:06 AM |
# 2
|
|
|
Hi,
Thanks for the reply.
Im not sure what you mean? Can you elaborate.
|
|
|
eMarketSouth
|
Posted: 27 September 2012 12:03 PM |
# 3
|
|
Developer
|
From looking at your code fragment, you don’t appear to be setting the summary string at all. Try something like:
{exp:channel:entries channel="news"}
{embedded_images} {exp:string:set name="image_{row_count}"} <img src="{image_upload}"> {image_text} {/exp:string:set} {exp:string:append name="summary"}{image_text}{/exp:string:append} {/embedded_images}
{exp:string:output} {summary} {/exp:string:output}
{/exp:channel:entries}
Sincerely,
Jack Scott
[edited October 2 - fixed an code error]
|
|
|
Kippi
|
Posted: 27 September 2012 01:07 PM |
# 4
|
|
|
Hi,
Thanks for your fast reply.
I tried your code but unfortunately it didinĀ“t work.
My template is outputting this:
Image Text{/exp:string:set} {image_1}
So the “image text” is being outputted but not the “image”
|
|
|
eMarketSouth
|
Posted: 02 October 2012 12:48 PM |
# 5
|
|
Developer
|
I found and fixed an error in the previous sample, I had an exp:string:set close tag instead of a exp:string:append close tag. Try the previous code sample again.
Are you using the String module to change a matrix field from a template? String can’t change a channel or matrix field, all it does is store strings in one part of your template and recall them later on.
|
|
|