How to insert into the field description ( maintext )

More
9 years 9 months ago - 9 years 9 months ago #61806 by ggppdk

How to insert into the field description ( maintext ) field of image / gallery or same some images eg. nr 1, 2, 3.


Hello

why don't you browse from inside your HTML editor,
then select them and insert them as images ?

Please note that:
Using the PHP CODE that is describe in this FAQ article:
www.flexicontent.org/documentation/faq/7...e-gallery-field.html

is meant to be used only inside a PHP template file:
item(_html5).php
category_items(_html5).php


-- 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!
Last edit: 9 years 9 months ago by ggppdk.

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

More
9 years 9 months ago #61807 by tadzio
In article text works:
<?php
// Connect to database
$db = JFactory::getDbo();
$query = $db->getQuery(true);

// Build the query
$query->select($db->quoteName(array('field_id', 'value')));
$query->from($db->quoteName('#__flexicontent_fields_item_relations'));
$query->where($db->quoteName('item_id') . ' LIKE '. $db->quote('%1005%'). ' AND '.$db->quoteName('field_id') . ' LIKE '. $db->quote('%15%'));
$query->setLimit('1');

$db->setQuery($query);
$results = $db->loadObjectList();

// Print the result
foreach($results as $result){
echo '<h3>' . $result->field_id . '</h3>';
echo $result->value;
}
?>

jumi has parameters and I can put everything to my article without template.

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

More
9 years 9 months ago - 9 years 9 months ago #61809 by ggppdk
Hello

it is almost no cost to execute such a query for item view e.g. <1 ms because you are query by ID

but you can also try this:
Code:
<?php print_r($item->fieldvalues); ?>

does it work ?
(it may work if $item is in scope ...)

if it works then you can use:
Code:
<?php print_r($item->fieldvalues[455]); ?>

where 455 is the FIELD ID of the image field


-- 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!
Last edit: 9 years 9 months ago by ggppdk.

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

More
9 years 9 months ago #61822 by tadzio

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

More
9 years 8 months ago #61835 by ggppdk
Hello

ok, so these will work only inside the template 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
9 years 8 months ago - 9 years 8 months ago #61841 by tadzio
Done.
First must be image field
php code and jumi plugin
Code:
<?php $img = $jumi[0]; //echo $img; $itemid = JRequest::getVar('id'); //echo JRequest::getVar('id'); // Connect to database $db = JFactory::getDbo(); $query = $db->getQuery(true); // Build the query $query->select($db->quoteName(array('field_id', 'value'))); $query->from($db->quoteName('#__flexicontent_fields_item_relations')); $query->where($db->quoteName('item_id') . ' LIKE '. $db->quote($itemid). ' AND '.$db->quoteName('field_id') . ' LIKE '. $db->quote('%36%')); $query->order($db->quoteName('valueorder')); $query->setLimit('10'); $db->setQuery($query); $results = $db->loadObjectList(); // Print the result $result = $results[$img]; $result = explode('"', $result->value); echo '<div style="text-align: center;">'; echo '<img src="images/stories/flexicontent/m_fld36_'.$result[3].'" alt="" />'; echo '<div style="text-align: center;">'.$result[15].' '.$result[11].'</div>'; echo '</div>'; ?>

In article text {jumi [*ID][img_nr]}
example:
blabla1
{jumi[*11][0]}
BLABLALALLLLA
NNMKSKASASA
{jumi[*11][1]}
example
Last edit: 9 years 8 months ago by tadzio.

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