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

More
9 years 10 months ago - 9 years 10 months 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: 9 years 10 months ago by yopyop001. Reason: Solved

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

More
9 years 10 months 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 review. Thanks!

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

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

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

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

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

More
9 years 10 months 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 review. Thanks!

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

More
9 years 10 months ago #60840 by yopyop001
:) :)

Thanks a lot !! It works.

This way i can :
1. Create per content type modules filtered dynamically by Author : logged user (=My items)
2. Create a content type : Dashboard
3. Create fields with type FC loadmodule (1 per module) and assign them to Dashboard type
4. Assign theses created fields in the Dashboard template

When a user log in => he is redirected to the dashobard and have a global view of his contents and a quick link to edit each of them

Thanks a lot
Have a nice day

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

More
9 years 10 months ago #60849 by micker
maybe vwe can adapt my flexiadmin module for front end ?

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

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