[SOLVED] How to load state and editing button in FC universal module

More
8 years 1 month ago - 8 years 1 month ago #60829 by yopyop001
Hi,

I need to load the editing / state buttons in the FC universal module. Is there a way to do that easily?
I have try lo load it with the FC functions, but without success.

I think it could be a good way to build quickly a user dashboard.

Best regards
Last edit: 8 years 1 month ago by yopyop001. Reason: Solved

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

More
8 years 1 month ago #60832 by ggppdk
Hello

copying the code
flexicontent_html::BUTTONNAME(.............)

from template files should work / is supposed to work


-- 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...

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

More
8 years 1 month ago - 8 years 1 month ago #60833 by ggppdk
Note,

inside the template file of the module
you may need to use the actual item object used in field creation
Code:
$item->_row
Code:
<?php $item->_row->parameters->set('show_editbutton', 1); $editbutton = flexicontent_html::editbutton( $item->_row, $item->_row->parameters); echo $editbutton; ?>


-- 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...
Last edit: 8 years 1 month ago by ggppdk.

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

More
8 years 1 month ago #60835 by yopyop001
Hi,
Thanks for the qucik answer,
It gives me an error :
Call to a member function set() on null

I have juste copy the default module template. Here is the full code :
Code:
<?php // no direct access defined('_JEXEC') or die('Restricted access'); $tooltip_class = FLEXI_J30GE ? 'hasTooltip' : 'hasTip'; $container_id = $module->id . (count($catdata_arr)>1 && $catdata ? '_'.$catdata->id : ''); ?> <div class="default mod_flexicontent_wrapper mod_flexicontent_wrap<?php echo $moduleclass_sfx; ?>" id="mod_flexicontent_default<?php echo $container_id; ?>"> <?php // Display FavList Information (if enabled) include(JPATH_SITE.'/modules/mod_flexicontent/tmpl_common/favlist.php'); // Display Category Information (if enabled) include(JPATH_SITE.'/modules/mod_flexicontent/tmpl_common/category.php'); $ord_titles = array( 'popular'=>JText::_( 'FLEXI_MOST_POPULAR'), 'commented'=>JText::_( 'FLEXI_MOST_COMMENTED'), 'rated'=>JText::_( 'FLEXI_BEST_RATED' ), 'added'=> JText::_( 'FLEXI_RECENTLY_ADDED'), 'addedrev'=>JText::_( 'FLEXI_RECENTLY_ADDED_REVERSE' ), 'updated'=>JText::_( 'FLEXI_RECENTLY_UPDATED'), 'alpha'=> JText::_( 'FLEXI_ALPHABETICAL'), 'alpharev'=>JText::_( 'FLEXI_ALPHABETICAL_REVERSE'), 'id'=>JText::_( 'FLEXI_HIGHEST_ITEM_ID'), 'rid'=>JText::_( 'FLEXI_LOWEST_ITEM_ID'), 'catorder'=>JText::_( 'FLEXI_CAT_ORDER'), 'random'=>JText::_( 'FLEXI_RANDOM' ), 'field'=>JText::_( 'FLEXI_CUSTOM_FIELD' ), 0=>'Default' ); $separator = ""; foreach ($ordering as $ord) : echo $separator; if (isset($list[$ord]['featured']) || isset($list[$ord]['standard'])) { $separator = "<div class='ordering_separator' ></div>"; } else { $separator = ""; continue; } ?> <div id="<?php echo 'order_'.( $ord ? $ord : 'default' ) . $module->id; ?>" class="mod_flexicontent"> <?php if ($ordering_addtitle && $ord) : ?> <div class='order_group_title'><?php echo $ord_titles[$ord]; ?></div> <?php endif; ?> <?php if (isset($list[$ord]['featured'])) : ?> <!-- BOF featured items --> <ul class="mod_flexicontent<?php echo $moduleclass_sfx; ?> mod_flexicontent_featured"> <?php foreach ($list[$ord]['featured'] as $item) : ?> <li class="<?php echo $item->is_active_item ? 'fcitem_active' : ''; ?>" > <a href="<?php echo $item->link; ?>" class="fcitem_link <?php echo $tooltip_class; ?>" title="<?php echo flexicontent_html::getToolTip($item->fulltitle, $item->text, 0, 1); ?>"> <?php echo $item->title; ?> </a> </li> <!-- EOF current item --> <?php endforeach; ?> </ul> <!-- EOF featured items --> <?php endif; ?> <?php if (isset($list[$ord]['standard'])) : ?> <!-- BOF standard items --> <ul class="mod_flexicontent<?php echo $moduleclass_sfx; ?> mod_flexicontent_standard"> <?php foreach ($list[$ord]['standard'] as $item) : ?> <li class="<?php echo $item->is_active_item ? 'fcitem_active' : ''; ?>" > <a href="<?php echo $item->link; ?>" class="fcitem_link <?php echo $tooltip_class; ?>" title="<?php echo flexicontent_html::getToolTip($item->fulltitle, $item->text, 0, 1); ?>"> <?php echo $item->title; ?> </a> <?php $item->_row->parameters->set('show_editbutton', 1); $editbutton = flexicontent_html::editbutton( $item->_row, $item->_row->parameters); echo $editbutton; ?> </li> <!-- EOF current item --> <?php endforeach; ?> </ul> <!-- EOF standard items --> <?php endif; ?> </div> <?php endforeach; ?> <?php // Display readon of module include(JPATH_SITE.'/modules/mod_flexicontent/tmpl_common/readon.php'); ?> </div>

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

More
8 years 1 month ago - 8 years 1 month ago #60837 by ggppdk
Hello

ok it seems item parameters were not needed and they were not created has not been created ?

Just do at the top of the template file
Code:
$basic_params = new JRegistry(); $_cparams = JComponentHelper::getParams('com_flexicontent'); // OPTIONAL $basic_params ->merge($_cparams); // OPTIONAL $basic_params ->set('show_editbutton', 1);

and then use inside your code: $basic_params


-- 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...
Last edit: 8 years 1 month ago by ggppdk.

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

More
8 years 1 month ago #60838 by ggppdk
Hello

if you want to shape the button then
search for the function inside
.../classes/flexicontent.helper.php

and see what parameters are used
- and set them into $basic_params via $basic_param->set()


-- 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...
The following user(s) said Thank You: yopyop001

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

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.297 seconds
Save
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