[Solved]Help in Image field

More
12 years 7 months ago - 12 years 7 months ago #38637 by brandonking
Hello,

I am trying to add some html before/after
Code:
$field->{$prop}

If I do like below,
Code:
$field->{$prop} = '<ul id="Gallery" >' . $field->{$prop} . '</ul>';

I am getting empty html for image field.

What am I doing wrong?
Thanks for your help! :D
Last edit: 12 years 7 months ago by brandonking.

Please Log in or Create an account to join the conversation.

More
12 years 7 months ago #38647 by ggppdk
Replied by ggppdk on topic [Solved]Help in Image field
Hello, you don't mean item form (prop is when field is displayed in content / content list views)

But you can, do that with the parameters:

Prefix - Suffix - Separator

or you mean something else ?


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star review. Thanks!

Please Log in or Create an account to join the conversation.

More
12 years 7 months ago #38649 by brandonking
Yes, it's for content view.
And I can not use prefix/suffix and opening/closing text because I trying to add a new jQuery plugin.

Please Log in or Create an account to join the conversation.

More
12 years 7 months ago #38650 by ggppdk
Replied by ggppdk on topic [Solved]Help in Image field
Hello,

you have more information than me
i cannot guess where you are changing what in the image field

e.g. the line with the
$field->{$prop} = '<ul id="Gallery" >' . $field->{$prop} . '</ul>';

i do not know the point at which it is placed,

e.g. at some point
$field->{$prop} is an array
and then it converted to string


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star review. Thanks!

Please Log in or Create an account to join the conversation.

More
12 years 7 months ago #38653 by brandonking
At the bottom of function onDisplayFieldValue,
Code:
//I want to add some required html format for each slide pulgin. if (!$detect->isMobile() && !$detect->isTablet()) { $val1='<ul id="carousel" class="elastislide-list">'; $field->{$prop} = $val1 . $field->{$prop} ;//. '</ul><div class="image-preview"><img id="preview"/></div>'; } else if ($detect->isMobile() || $detect->isTablet()){ $field->{$prop} = '<ul id="Gallery" >' . $field->{$prop} . '</ul>'; } // Apply seperator and open/close tags if ( count($field->{$prop}) && $usepopup && $popuptype == 5) { $field->{$prop} = $opentag . ' <div id="gf_container"> <div id="gallery" class="content"> <div id="gf_controls" class="controls"></div> <div class="slideshow-container"> <div id="gf_loading" class="loader"></div> <div id="gf_slideshow" class="slideshow"></div> </div> <div id="gf_caption" class="caption-container"></div> </div> <div id="gf_thumbs" class="navigation"> <ul class="thumbs noscript"> '. implode('', $field->{$prop}) .' </ul> </div> <div style="clear: both;"></div> </div> ' . $closetag; } else if( count($field->{$prop})) { $field->{$prop} = implode($separatorf, $field->{$prop}); $field->{$prop} = $opentag . $field->{$prop} . $closetag; } else { $field->{$prop} = ''; }

I have added some code but displayed empty except opentag/closetag.

Please Log in or Create an account to join the conversation.

More
12 years 7 months ago #38654 by brandonking
Basically, I found two nice image slide/carousel and trying to display one for pc and the other for mobile/tablet.
Everything works great but I need to add required HTML format for each plugin.
Not sure how to attach some HTML before and after the $field->{$prop}.

Because of I am adapting two plugins I can not use opentag/closetag.

Please Log in or Create an account to join the conversation.

More
12 years 7 months ago #38656 by ggppdk
Replied by ggppdk on topic [Solved]Help in Image field
Hello,

$field->{prop} is an array and you are assigning it as if it if of scalar type (non-array)

it is array because it contains the images

look at the bottom of the function there is an implode statement that convert the array to a string maybe you want to add code there


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star review. Thanks!

Please Log in or Create an account to join the conversation.

More
12 years 7 months ago #38658 by brandonking
I have tried like below.
Code:
$field->{$prop} = '<ul id="Gallery" >'. implode('', $field->{$prop}) . '</ul>';
But it didn't work..

Please Log in or Create an account to join the conversation.

More
12 years 7 months ago #38659 by ggppdk
Replied by ggppdk on topic [Solved]Help in Image field
Please ,

enable error_reporting in the site too

also you can implode there,

remember the implode is called again at the end of the function


please place your code after the implode at the end of the function, replace:
Code:
$field->{$prop} = implode($separatorf, $field->{$prop}); $field->{$prop} = $opentag . $field->{$prop} . $closetag;
with
Code:
$field->{$prop} = implode($separatorf, $field->{$prop}); // YOUR CODE


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star review. Thanks!

Please Log in or Create an account to join the conversation.

More
12 years 7 months ago #38662 by brandonking
Sorry, didn't know that I can not use implode twice!! :oops:
As soon as I finish, I will PM you my work.

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline
Save