ajout d'une image au plugin FCPageNav

More
10 years 8 months ago #45407 by Claire39
Bonjour!

je voudrais ajouter une vignette dans la navigation entre différents articles d'une catégorie:

<a>image-titre article précédent - <a>titre article suivant-image

cette image pourrait être insérée soit dans la gestion des menus (Paramètre du type de lien>Image du lien) soit directement dans l'artile (un champ en particulier par exemple?) en fonction de ce qui est faisable.

Pourriez vous m'aider à faire ça?
Merci!

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

More
10 years 8 months ago #45410 by ggppdk
Hello

this is of course possible to implement,
and will be nice to have this :-)


-- just now it is not implemented, (if you ask if there is parameter to enable this do)


-- and also the code needed for this is similar to code already used by relation, relation_reverse fields,


but development work to add a feature takes time, have you seen our feature request policy in our FAQ:

About FLEXIcontent feature requests

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
10 years 8 months ago #45412 by Claire39
Hi!

I understand that my request could be a new developpement for the future... but it doesn't exist now...

And I'm ready to do it without waiting for a new FC release!

But... could you give me some help?

-and also the code needed for this is similar to code already used by relation, relation_reverse fields


Could you explain a little bit please?

While waiting your answer, I will try to understand something in my php file...
;)

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

More
10 years 8 months ago #45416 by ggppdk
Hello

And I'm ready to do it without waiting for a new FC release!


ok but you will do it ?
or you mean that i will do it?
(your words you are asking free custom development)


have you read the FAQ article that i gave you above ?, please read it


- further more most of the needed code exists in our FAQ too


Here it is:

after:
Code:
$field->nexturl = JRoute::_(FlexicontentHelperRoute::getItemRoute($field->next->slug, $field->next->catslug));
add:
Code:
$next_item_id = (int)$field->next->slug; $itemmodel_name = FLEXI_J16GE ? 'FlexicontentModelItem' : 'FlexicontentModelItems'; $itemmodel = new $itemmodel_name(); $_next_item = $itemmodel->getItem($next_item_id, $check_view_access=false); $_the_items = array(&$_next_item); FlexicontentFields::getFields($_the_items); FlexicontentFields::getFieldDisplay($_next_item, 'my_image_field', 'display_small'); $field->nextimage = $_next_item->fields['my_image_field']->display_small;

Find this
Code:
... .$next_count.'
and change it to be:
Code:
... .$next_count.$field->nextimage.'


Please
1. test and --correct-- the code that i have given you
2. Do the similar thing for previous link

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
10 years 8 months ago #45433 by Claire39
Hi!

thank you for your answer :)

when I wrote "And I'm ready to do it without waiting for a new FC release!", I just mean that I want to do it by myself.

I sometimes need help, because it could happend that I don't know how to do a request to the database for example, but I want to try and understand how to solve problems!

I'll try what you suggested me, and if I get best results than what I've already done, I will give here the all script.

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

More
10 years 8 months ago #45434 by Claire39
while waiting for you answer, I've tried something like that :

- get the article ID
Code:
line 222 if ($field->prev) { $field->previd = $field->prev->id; //here! $field->prevtitle = $field->prev->title; $field->prevurl = JRoute::_(FlexicontentHelperRoute::getItemRoute($field->prev->slug, $field->prev->catslug)); } else { $field->previd = '0'; //and here! $field->prevtitle = ''; $field->prevurl = ''; } if ($field->next) { $field->nextid = $field->next->id; //and here! $field->nexttitle = $field->next->title; $field->nexturl = JRoute::_(FlexicontentHelperRoute::getItemRoute($field->next->slug, $field->next->catslug)); } else { $field->nextid = '0'; //and here! $field->nexttitle = ''; $field->nexturl = ''; }
- have a folder in images/ with the thumbnails, named whith the article's ID (17.jpg, 18.jpg....) and a sample image named 0.jpg

- call the image in the prev/next link with the ID of the prev/next article
Code:
$html .= ' <a href="'. $field->prevurl .'" class="'. $field->previd .'"> <div class="cinquante btn pagenav_prev' . ($use_tooltip ? ' hasTip' : '') . '"' . ($use_tooltip ? 'title="'.$tooltip_title_prev.'::'.$field->prevtitle.'"' : '') . '> //call the image here! <div class="cinquante miniature"><img src="images/references/vignettes/'. $field->previd .'.jpg"></div> <div class="cinquante lien">' . ( $use_title ? $field->prevtitle : htmlspecialchars($prev_label, ENT_NOQUOTES) ) .$prev_count.' </div> </div> ' ;

It works, but I'll try your solution too.

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

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