Champs personnalisés dans tableau

More
12 years 5 months ago #26160 by starscream
Salut à tous,

J'ai regardé un peu mais je n'ai pas trouvé ( peut etre pas bien cherché ) de solution pour afficher mes champs personnalisés dans un tableau à l'intérieur d'un article en Front.

Vous avez une solution ?

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

More
12 years 5 months ago #26164 by micker
simplement comme ceci
Code:
<?php echo $this->fields->nom_du_champ->display; ?>
ca permet de charger les champs à la demande !
donc tu créer ton tableau et tu charge tes valeur dedans
un tuto pour les vues catégories
www.flexicontent.org/forum/index ... =viewtopic
a+

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.

More
12 years 5 months ago #26166 by starscream
Ok, et ceci dans mon item.php ?

voilà de que ca donne pour le moment :
Code:
<?php defined( '_JEXEC' ) or die( 'Restricted access' ); // on définit ici le nom du template $tmpl = $this->template1; ?> <div id="contenu"> <div id="name">&nbsp;</div> <div id="support_name">&nbsp;</div> <div id="publication_type">&nbsp;</div> <div id="campaign_name">&nbsp;</div> <div id="announce_format">&nbsp;</div> <div id="delivery_date">&nbsp;</div> <div id="release_date">&nbsp;</div> <div id="country">&nbsp;</div> <div id="statut">&nbsp;</div>

Le nom "Template1" est le nom de mon template que je vais utiliser
Et voici mon item.xml
Code:
<?xml version="1.0" encoding="utf-8"?> <form> <author>Emmanuel Danan</author> <website>www.flexicontent.org</website> <email>emmanuel@vistamedia.fr</email> <license>GPLv2</license> <version>1.1</version> <release>25 november 2009</release> <description>Modular item layout suitable for faq, file manager, or directory</description> <fields name="attribs"> <fieldset name="attribs" addfieldpath="/administrator/components/com_flexicontent/elements"> <field name="title_cut_text" type="text" size="3" default="200" label="FLEXI_TITLE_MAXLEN" description="FLEXI_TITLE_MAXLEN_DESC" /> <field name="top_cols" type="list" default="two" label="FLEXI_ITEM_TOP_COLS" description="FLEXI_ITEM_TOP_COLS_DESC"> <option value="">FLEXI_USE_GLOBAL</option> <option value="one">FLEXI_1_COL</option> <option value="two">FLEXI_2_COLS</option> </field> <field name="bottom_cols" type="list" default="two" label="FLEXI_ITEM_BOTTOM_COLS" description="FLEXI_ITEM_BOTTOM_COLS_DESC"> <option value="">FLEXI_USE_GLOBAL</option> <option value="one">FLEXI_1_COL</option> <option value="two">FLEXI_2_COLS</option> </field> </fieldset> </fields> <fieldgroups> <group>name</group> <group>support_name</group> <group>publication_type</group> <group>campaign_name</group> <group>announce_format</group> <group>delivery_date</group> <group>release_date</group> <group>country</group> <group>statut</group> </fieldgroups> <cssitem> <file>css/item.css</file> </cssitem> <jsitem> </jsitem> </form>

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

More
12 years 5 months ago #26168 by starscream
Bon j'ai du mal faire quelque chose, ya rien à faire, les champs n'apparaissent pas sur le front office alors qu'ils apparaissent bien dans l'article en admin.

Je ne peux les faire apparaitre sur le front uniquement en les mettant à la main ( champ, ) dans les parametres du module.

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

More
12 years 5 months ago #26173 by ggppdk
1. You will need to duplicate 'default' template e.g. to a new template 'mydefault'

2. Read template tutorial:
blog.netassopro.com/tutoriel-tem ... structure/

3. Goto to components/com_flexicontent/templates/mydefault/

4. Edit item.xml to add a new FIELD position 'mytable', then clear Joomla cache in backend

5. Edit item.php to get fields of mytable position and display them in a table via LOOP

6. Go to backend and edit ITEM LAYOUT of mydefault TEMPLATE and add the fields you need

7. Go to frontend and display the item, correct and mistakes you have in item.php

Regards


-- 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
12 years 5 months ago #26174 by micker
non pas comme ca ...
la tu charge les champs directement tu ne peu pas utiliser les positions
Code:
<?php defined( '_JEXEC' ) or die( 'Restricted access' ); // on définit ici le nom du template $tmpl = $this->template1; ?> <div id="contenu"> <div id="name"><?php echo $this->fields->name->display; ?></div> <div id="support_name"><?php echo $this->fields->support_name->display; ?></div> <div id="publication_type"><?php echo $this->fields->publication_type->display; ?></div> ...etc
la tu n'utilise pas l'admin template tu charges directement les champs
pour utilser le template utilise la syntaxe
Code:
<!-- BOF lien block --> <?php if (isset($this->item->positions['LENOMDETAPOSITION'])) : ?> <div class="LENOMDETADIV"> <?php foreach ($this->item->positions['LENOMDETAPOSITION'] as $field) : ?> <span class="element <?php echo $columnmode; ?>"> <?php if ($field->label) : ?> <span class="fclabel field_<?php echo $field->name; ?>"><?php echo $field->label; ?></span> <?php endif; ?> <span class="fcvalue field_<?php echo $field->name; ?><?php echo !$field->label ? ' nolabel ' : ''; ?>"><?php echo $field->display; ?></span> </span> <?php endforeach; ?> </div> <?php endif; ?>
apres avec du css tu devrait pouvoir presenter ca comme un tableau
Voila

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
Time to create page: 0.441 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