Templates comment faire ?

More
10 years 11 months ago #36485 by webscom
Replied by webscom on topic Templates comment faire ?
merci...

Je me rends compte que j'ai travailler un peu pour rien, je croyais que les fichiers (un fichiers charger dans l'admin joomla) était intégré dans un répertoire spécifique par rapport à l'id de l'article par exemple, mais il n'en est rien, cela sous entend que des conflits pourraient exister si 2 fichiers du même nom était chargé (avec ma méthode)

Finalement le fichier et son chemin est du type
Code:
/joom_flexi/index.php/mon-premier-object/download/12/1/17/vase.stl

mais le stockage ne se fait pas dans ce répertoire mais:
Code:
\components\com_flexicontent\uploads

Mon fichier item.php était ainsi:
Code:
<?php defined( '_JEXEC' ) or die( 'Restricted access' ); // on définit ici le nom du template $tmpl = $this->tmpl; ?> <article class="item-page"> <!-- BOF header block --> <Header> <h1> <?php echo $this->params->get('page_heading'); ?> </h1> <ul> <?php foreach ($this->item->positions['header'] as $field) : ?> <li> <?php echo $field->label; ?> <?php echo $field->display; ?> </li> <?php endforeach; ?> </ul> </header> <!-- EOF header block --> <div id="object_tri"> <div> <?php foreach ($this->item->positions['subtitle1'] as $field) : ?> <?php echo $field->label; ?> <?php echo $field->display; ?> <?php endforeach; ?> </div> <div> <?php foreach ($this->item->positions['subtitle2'] as $field) : ?> <?php echo $field->label; ?><br /> <?php echo $field->display; ?> <?php endforeach; ?> </div> <div id="bt"> <?php foreach ($this->item->positions['subtitle3'] as $field) : ?> <?php $fichier = $field->display; echo $fichier; preg_match('`href="([^"]+)"`i',$fichier,$chemin); preg_match_all("/(<([\w]+)[^>]*>)(.*?)(<\/\\2>)/", $fichier, $matches, PREG_SET_ORDER); foreach ($matches as $val) { $nom_du_fichier = $val[3]; } $chemin = $chemin[1].'/'.$nom_du_fichier; echo $chemin ; ?> <a class="triview" target="_blank" rel="rokbox[820 620]" href="index.php?option=com_content&view=article&id=2&Itemid=123&myobject3d=<?php echo $chemin ;?>">&nbsp; <?php endforeach; ?> </div> </div> </div> </ARTICLE>
Je pourrais en php définir le chemin exacte, mais n'est-t-il pas possible dans Flexicontent d'avoir un répertoire différents pour chaques fichiers ? (je sais je sors de ma question initial sur les templates, si je dois ouvrir un nouveau post dans une nouvelle section n'hésitez pas à me l'indiquer.)

Donc globalement j'ai compris comment fonctionnait l'overide d'un template. Mais mon soucis maintenant est la gestion des fichiers.

Merci d'avance de vos lumières
Attachments:

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

More
10 years 11 months ago #36489 by micker
Replied by micker on topic Templates comment faire ?
désoler je ne comprend rien .. ;)
pris tu être plus explicite ?... que veus tu faire exactement ?
pourquoi y aurait il un soucis de fichier ?
pareil pour l administration ... je comprends pas ton but

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
10 years 11 months ago #36496 by webscom
Replied by webscom on topic Templates comment faire ?
Bonjour,

J'ai ce matin réglé mes soucis :

Mon but était de récupérer un fichier ajouter par un type de champ 'file', dans une autre page (en popup exactement),donc pour récuperer ce fichier (format .stl pour information), était d'avoir le nom réel du fichier (Flexicontent renomme le nom réel des fichiers si 2 fichiers portent le même nom), et bien sur son chemin (path), je pensais qu'il était possible directement d'avoir ces informations, mais il n'en était rien du tout.

J'ai demandé donc dans un autre poste -> www.flexicontent.org/forum/index.php?f=9&t=6263&rb_v=viewtopic comment je pouvais récupérer le nom réel du fichier (pour le chemin c'était simple)

Juste pour information:

Je joins une image de ce que je voulais faire (cela fonctionne maintenant)
1 -> bouton pour ouvrir une page dans une popup qui vient charger le fichier au format stl qui est transmit dans l'url.
2 -> Ma nouvelle page dans un popup qui va charger le fichier .stl pour l'afficher en 3d

Le code de mon template devient : (il n'est pas fini)
Code:
<?php defined( '_JEXEC' ) or die( 'Restricted access' ); // on définit ici le nom du template $tmpl = $this->tmpl; ?> <article class="item-page"> <!-- BOF header block --> <Header> <h1> <?php echo $this->params->get('page_heading'); ?> </h1> <ul> <?php foreach ($this->item->positions['header'] as $field) : ?> <li> <?php echo $field->label; ?> <?php echo $field->display; ?> </li> <?php endforeach; ?> </ul> </header> <!-- EOF header block --> <!-- BOF object_tri block --> <div id="object_tri"> <?php if (isset($this->item->positions['subtitle1'])) : ?> <div> <?php foreach ($this->item->positions['subtitle1'] as $field) : ?> <?php echo $field->label; ?> <?php echo $field->display; ?> <?php endforeach; ?> </div> <?php endif; ?> <?php if (isset($this->item->positions['subtitle2'])) : ?> <div> <?php foreach ($this->item->positions['subtitle2'] as $field) : ?> <?php echo $field->label; ?><br /> <?php echo $field->display; ?> <?php endforeach; ?> </div> <?php endif; ?> <?php if (isset($this->item->positions['subtitle3'])) : ?> <div id="bt"> <?php foreach ($this->item->positions['subtitle3'] as $field) : ?> <?php $fichier = $field->display; echo $fichier; preg_match('`href="([^"]+)"`i',$fichier,$chemin); preg_match_all("/(<([\w]+)[^>]*>)(.*?)(<\/\\2>)/", $fichier, $matches, PREG_SET_ORDER); foreach ($matches as $val) { $nom_du_fichier = $val[3]; } //---vérification si le fichier est existant dans le répertoire components\com_flexicontent\medias //premier chemin (path) $chemin1 = "components/com_flexicontent/medias/".$nom_du_fichier; if (file_exists($chemin1)) { $chemin_nom = $chemin1; echo $chemin_nom ; } ?> <a class="triview" target="_blank" rel="rokbox[820 620]" href="index.php?option=com_content&view=article&id=2&Itemid=123&myobject3d=<?php echo $chemin_nom ;?>">&nbsp; <?php endforeach; ?> </div> <?php endif; ?> </div> <!-- EOF object_tri block --> </ARTICLE>

Donc au final avec ma modification de plugin (voir autre post), j'ai réussi à faire ce que je voulais, je suis en phase test et faisabilité, donc je vais amélioré le code.

Merci de votre aide en tout cas ;)
Attachments:

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

More
10 years 11 months ago #36502 by micker
Replied by micker on topic Templates comment faire ?
ok si tu trouves super
regarde la faq tu trouveras plein de choses
a.plus

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
10 years 11 months ago #36525 by ggppdk
Replied by ggppdk on topic Templates comment faire ?
Hello,

FLEXIcontent comes with meany features and is free :D , has basic documentation free too, the work to achieve a specific purpose is mainly on the shoulders of a developer or web designer ;)

Also if you create a custom template that you would want to share the you can post it in this forum

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.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.299 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