Ajax in the derivation of articles in this category

More
12 years 1 week ago #37656 by Miken
Hi
Tell me whether you can do it this way?
1. When entering into the category of seeing a list of 6 materials from this category.
2. At the bottom of the button "More" button, which when loaded via AJAX other materials from this category?

Flexicontent 3.1.1 & Joomla 3.7.1

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

More
12 years 1 week ago #37657 by ggppdk
Hello,

miken wrote: 1. When entering into the category of seeing a list of 6 materials from this category.

Maybe set your category to display 6 items per page in category configuration or set in component configuration to affect all categories (leave the per page parameter empty in your categories configuration)

miken wrote: 2. At the bottom of the button "More" button, which when loaded via AJAX other materials from this category?

What is loaded via AJAX ?
You want the read more to load the article inline , a similar question has been answered to forum before, you will need some custom development


-- 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 1 week ago #37658 by Miken
I could not find something similar search so I wrote my question. Maybe you tell me where it was?

Flexicontent 3.1.1 & Joomla 3.7.1

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

More
12 years 1 week ago #37664 by ggppdk
My answer there was something like this:

1. create a custom FLEXIcontent template in template manager
2. edit category_items.php file of this new template to do load in an iframe the URL of item view of an item when read more link is clicked

e.g. the read more link for blog template (to find and change) in the code is like this:
Code:
<a href="<?php echo JRoute::_(FlexicontentHelperRoute::getItemRoute($items[$i]->slug, $items[$i]->categoryslug)); ?>" class="readon"> <?php if ($items[$i]->params->get('readmore')) : echo ' ' . $items[$i]->params->get('readmore'); else : echo ' ' . JText::sprintf('FLEXI_READ_MORE', $items[$i]->title); endif; ?>

this must be changed to (please add width,height etc to the iframe HTML TAG):
Code:
<iframe id="fcitem_frame_<?php echo $items[$i]->id;?>"></iframe> <a src="#" onclick="document.getElementById('fcitem_frame_<?php echo $items[$i]->id;?>').src="<?php echo JRoute::_(FlexicontentHelperRoute::getItemRoute($items[$i]->slug, $items[$i]->categoryslug).'&tmpl=component'); ?>" class="readon"> <?php if ($items[$i]->params->get('readmore')) : echo ' ' . $items[$i]->params->get('readmore'); else : echo ' ' . JText::sprintf('FLEXI_READ_MORE', $items[$i]->title); endif; ?>


-- As you can see the url must be slightly changed to load only the component area (thus you need to append variable '&tmpl=component')

-- Please make any corrections needed yourself i mean read online documentation about iframe, javascript, etc, also if you want the click to also hide the item you need a little more JS code above

-- NOTE that blog template ALSO includes code to open items in modal popup !! you can un-comment this code if you want (a future version will enable it via a new category parameter)

CODE to uncomment is:
Code:
/*$uniqueid = "read_more_fc_item_".$items[$i]->id; $itemlnk = JRoute::_(FlexicontentHelperRoute::getItemRoute($items[$i]->slug, $items[$i]->categoryslug).'&tmpl=component'); echo '<script>document.write(\'<a href="'.$itemlnk.'" id="mb'.$uniqueid.'" class="mb" rel="width:\'+((MooTools.version>='1.2.4' ? window.getSize().x : window.getSize().size.x)-150)+\',height:\'+((MooTools.version>='1.2.4' ? window.getSize().y : window.getSize().size.y)-150)+\'">\')</script>'; */

and :
Code:
<?php //echo '<script>document.write(\' <div class="multiBoxDesc mbox_img_url mb'.$uniqueid.'">'.$items[$i]->title.'</div>\')</script>'; ?>


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 1 week ago #37668 by Miken
Thank you. Studied the issue and made a girlfriend under the task


edited category_items.php

In the end, add the following:

Code:
<? $vi = JRequest::getVar('tmpl'); if ($vi != 'component') { ?> <div id="readload"><a id="port_readmore" href="<?php echo JRoute::_(FlexicontentHelperRoute::getCategoryRoute($categoryslug), false); ?>?limit=50&limitstart=6&tmpl=component">Show more</div> <div id="more-content"></div> <script type="text/javascript"> window.addEvent('domready', function() { $('port_readmore').addEvent('click', function(e) { e = new Event(e); e.preventDefault(); // блокируем стандартное действие при клике // создаем объект запроса $('more-content').set('html', "Идет обработка запроса..."); var r = new Request({ method: 'get', // GET запрос url: this.href, // адрес запроса берем из адреса ссылки onSuccess: function(responseText) { // это мы делаем, когда все ок $('more-content').set('html', responseText); $('readload').destroy(); }, onFailure: function() { // если все плохо alert('Что-то не так :('); } }); r.send(); // отправляем запрос }); }); </script> <? } ?>

So what happens is that you need. Just downloaded a lot of excess.

Flexicontent 3.1.1 & Joomla 3.7.1

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

More
12 years 1 week ago #37670 by micker
thanks for shareing

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.427 seconds
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