pagenavigation plugin with preview

90 views
Skip to first unread message

seagul

unread,
Jul 23, 2012, 5:46:10 PM7/23/12
to joomla-de...@googlegroups.com
Hi there,

I am developing a plugin for page navigation with a preview to the next/prev item.
I get hold of the field where the images are saved but the value looks like this:
{"image_intro":"images\/content\/BSP_Files\/xxxxxxxxxxxxx.jpg","float_intro":"","image_intro_alt":"","image_intro_caption":"","image_fulltext":"images\/content\/BSP_Files\/xxxxxxxxxxxx.jpg","float_fulltext":"","image_fulltext_alt":"","image_fulltext_caption":""}
        )

I guess there is already a function to return the value of the "image_intro" but where can I find it? I cannot find the standard function to return the image so far.

Thanks for any hints.
Seagul

Neil

unread,
Jul 25, 2012, 5:29:05 PM7/25/12
to joomla-de...@googlegroups.com
I am not sure what you are looking to do. The title states page navigation, but you are looking for an image? I am confused.

seagul

unread,
Jul 26, 2012, 12:36:26 PM7/26/12
to joomla-de...@googlegroups.com
Thanks for asking.

Yes, I want a page navigation with a small image of the next or previous article.
Each article in J2.5 can have an "intro image".
I want to show the prev- and next-buttons with a preview-image (=the intro image) of the previous- and next-article.
I attached a graphic to see what image I mean.

So, in the code of the plugin pagenavigation I want to get the picture from the prev- and next article. With which function or method could I get the "intro image" from the database field "images"? I can show the title of the prev- and next article already but I thought there would be a  function to get the picture of the "images"-field of the database.

Thanks for any help.
article-prev-next-image.gif

Swapnil Shah

unread,
Jul 26, 2012, 4:51:22 PM7/26/12
to joomla-de...@googlegroups.com
I haven't looked at the article model in a while. But why not just query the database for the two articles you need? You can either grab the entire table or just the image fields. 

How are you getting the titles? 

Do you have access to the template overrides? Page navigation override might be easier? 

Regards, 


Neil
Sent from my iPhone
--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To view this discussion on the web, visit https://groups.google.com/d/msg/joomla-dev-general/-/5XI_izvl4aEJ.
To post to this group, send an email to joomla-de...@googlegroups.com.
To unsubscribe from this group, send email to joomla-dev-gene...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/joomla-dev-general?hl=en-GB.
<article-prev-next-image.gif>

seagul

unread,
Jul 26, 2012, 4:59:17 PM7/26/12
to joomla-de...@googlegroups.com
Page navigation override does not work. I already tried and asked somebody else, I have to use the plugin.

I actually get the image values with a database query but they look like this:

{"image_intro":"images\/content\/BSP_Files\/xxxxxxxxxxxxx.jpg","float_intro":"","image_intro_alt":"","image_intro_caption":"","image_fulltext":"images\/content\/BSP_Files\/xxxxxxxxxxxx.jpg","float_fulltext":"","image_fulltext_alt":"","image_fulltext_caption":""}
        )

And I dont't know how to get the actually image value into my code. How can I extract the "intro image" from this field value. As in the field "images" is not only one image but the "intro image" and the "Full article image".

I could not find a function to extract the "intro image" from this database field.
Any ideas?
Thanks!!!


Swapnil Shah

unread,
Jul 26, 2012, 5:08:44 PM7/26/12
to joomla-de...@googlegroups.com
That string is json encoded. You can grab a jregistry object. Feed that string in and then ask it to get you the intro image. 


Regards, 


Neil
Sent from my iPhone
--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To view this discussion on the web, visit https://groups.google.com/d/msg/joomla-dev-general/-/T3gXlOuMiT8J.

seagul

unread,
Jul 26, 2012, 5:40:10 PM7/26/12
to joomla-de...@googlegroups.com
Thanks.
I just used now:

                $registry = new JRegistry;
                $registry->loadString($row->prev->images);
                $item->images = $registry->toArray();

works fine!

Swapnil Shah

unread,
Jul 26, 2012, 5:46:57 PM7/26/12
to joomla-de...@googlegroups.com
You could cut that code down by one line and use 

$registry->get('intro_image', null);


Regards, 


Neil
Sent from my iPhone
--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To view this discussion on the web, visit https://groups.google.com/d/msg/joomla-dev-general/-/xI7LQIiFEZYJ.

seagul

unread,
Jul 26, 2012, 6:23:36 PM7/26/12
to joomla-de...@googlegroups.com
great thanks a lot!!!

Swapnil Shah

unread,
Jul 26, 2012, 6:57:10 PM7/26/12
to joomla-de...@googlegroups.com
No problem, glad I could help


Regards, 


Neil
Sent from my iPhone

On Jul 26, 2012, at 6:23 PM, seagul <webgr...@gmail.com> wrote:

great thanks a lot!!!


--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To view this discussion on the web, visit https://groups.google.com/d/msg/joomla-dev-general/-/5NcsV2Yx5tYJ.

elin

unread,
Jul 26, 2012, 7:59:37 PM7/26/12
to joomla-de...@googlegroups.com
You're going to need to decode the JSON.

Elin
Reply all
Reply to author
Forward
0 new messages