Joomla 2.5 disable pagination? - pagination

I built a component in joomla 2.5 (back end) and even if I don't include code for pagination, my results aren't displayed fully (they are limited to about 20). Is there a way where I can have all my results show on default? Or in other words disable pagination? Thanks!

In your list model, set the list.limit state accordingly. By default it will use the global list limit.
You can use this code in the populateState() function:
$this->setState('list.limit', 0);
Please note that if you call parent::populateState($order, $dir);, this will also set the list.limit. So you either don't call the parent function or your set the state after the parent function was called.

firstly open your custom component view file, which is located in
/components/component_name/views/tmpl - file name is default.php and now comment this line
<?php echo $this->loadTemplate('_header'); ?>
and also
<?php echo $this->loadTemplate('_footer'); ?>
may very much help!
or another way is that goto joomla administrato - site - globle confi - Default List Limit
change limit

Related

Set Modx Revolution :nl2br to Output HTML

Is there a way to set Modx Revolution to output HTML <br>s using the :nlb2r output filter rather than XHTML <br />s through a system setting?
Just create custom snippet - http://rtfm.modx.com/display/revolution20/Input+and+Output+Filters+%28Output+Modifiers%29 , as example:
<?php
$mode = !empty($options) ? true : false;
return nl2br($input, $mode);
This filter does not depend on the system settings, he is located in the code modx- https://github.com/modxcms/revolution/blob/develop/core/model/modx/filters/modoutputfilter.class.php#L431 so you need to create custom snippet.
Output filters are hard coded.
You could always:
SomeElement:nl2br:replace=`<br />==<br>`
Not really sure you want to drop the / as HTML5 simply ignores it. But any case, replace will serve you well.
Check out chapter 7 of my book, it has all of the filters and examples on how to chain them.
You should avoid using snippets and filters are much as you can. They increase the parsing-time.
There's a setting for what you ask
Search for tiny.element_format and change it to html.

How to display modules only on search results in Joomla 2.5?

Hello please read the whole question, this isn't just solved by enabling the modules only for the search page:
I have a few modules that are exclusively shown on the search page in Joomla.
I created a hidden menu entry for the search as well in order to tell modules to only show on this page. This works alright, but when I click one of the results and get redirected to the actual result, then the modules, which should only show up on the search page are still shown in the result page.
Any clue how to fix this? Really annoying as I use 3rd party search enhancing modules, and they are showing on the results.
Using standard Joomla, there's no way to target modules to only the search results page and none of the pages that link off the results – but I know you knew that! The hidden menu item is a help, but does not change the menu item of some of the links off that page. It's all to do with the allocation and use of "Itemids" in Joomla.
To be able to target modules more specifically, you need to use a 3rd-party extension. I developed MetaMod (www.metamodpro.com) to cope with exactly this use case. MetaMod is a wrapper module that can then decide just which other module to include in itself (or not). So you assign the MetaMod to the page, then put a snippet of code inside the MetaMod which decides which other module to include.
In this case, I'd use the following in MetaMod:
if ($core_genius->check("pagetype = search, searchresults")) return XXX;
// replace XXX with the module id of the module to include
// ONLY on the search page, or the searchresults page, but
// no other type of page.
Hope that helps,
Stephen
Although MetaMod is great (I've used it myself & Stephen's support is great!) there is another way to do it without using 3rd party extensions.
You could create new module positions in your template above (or below) the module positions you wanted to use and wrap them in an if statement like so:
<?php if(!isset(JRequest::getString('searchword'))) : ?>
<jdoc:include type="modules" name="right-search" style="xhtml" />
<?php endif; ?>

Pagination [+next+] not working on MODx CMS template

I'm having difficulty getting the pagination functionality working with [[Ditto? ... ]] in MODx CMS.
I have the documents displaying in the page, limit is set to 5. The output from my other pagination template placeholders seem to be working but the [+next+] link doesn't load the next set of 5 documents (going in descending date order).
Here's my template code:
[[Ditto?
&parents=`13`
&tpl=`ArticleListChunk`
&display=`5`
&&removeChunk=`Comments`
&paginate=`1`
&extenders=`summary,dateFilter`
&paginateAlwaysShowLinks=`0`
&dateFormat=`%F %D %Y`
]]
<p>Showing <strong>[+start+]</strong> - <strong>[+stop+]</strong> of <strong>[+total+]</strong> Articles</p>
<ul class="clearfix">
<li>[+previous+]</li>
<li>Page <strong>[+currentPage+]</strong> of [+totalPages+]</li>
<li>[+next+]</li>
</ul>
The output I get is:
Showing 1 - 5 of 17 Articles
Page 1 of 4
Next >
as you can see the output is correct, however when I click the 'next' link the resulting URL is .../news.html?start=5 but the content of the page stays the same (i.e. the latest 5 documents are shown!).
This is how the template and functionality was when I was inherited this project from a client, and I have never used MODx CMS before -- can anyone help me please?
I there a way to update the SQL offset with a parameter or something? I've been all through the Wiki pages for Ditto / MODx but can't find what I need or what I should be doing that I'm not!
I would think you need to call ditto uncached [[!Ditto? attribs ]]
That's just a guess.
Also it looks like you are using EVO? check the cache syntax, you might need to put an exclamation mark at the end as well. [[!Ditto? attribs !]]
After plenty of searching I found a post on the MODx forum that pointed me in the right direction.
Turns out that caching was enabled in the page/document's settings (doh!). I disabled this and now it works fine!
However I have not set the no-caching token ('!') in Ditto's parameter string which, including the answer from Sean, my research has suggested is advisable and/or required. I've not worked with MODx before so I can't say for certain, but it seems to work without this for me!
Thanks #SeanKimball as your answer set me down the right path.

how to hide Showing result text in liferay Search Container?

I am using liferay search container to display list of information, but in that liferay search container by default display number of records like "Showing 2 results". But in my case i don't want to display this. How can I remove this? Also attached the image of search container.
Suggestions are welcome.
You can do this with Javascript as suggested by Felix Christy:
Here are the quick steps :
Go to "Manage Page" section of the desired page (page on which you
dont want to show this text)
Go to javascript section add the following, its Alloy UI javascript framework which comes bundled with liferay:
AUI().ready(
function(customA) {
customA.all('.taglib-page-iterator').hide(); // this would hide **all** the elements which have the class "taglib-page-iterator"
}
);
The above javascript code can be included in the custom portlet's JSP itself (note the method and selector which I have changed), like:
<aui:script>
AUI().ready(
function(customA) {
customA.one('#my-portletID .taglib-page-iterator').hide(); // this would hide only **one** element (the first it finds) which has the css class "taglib-page-iterator" under an element with id="my-portletID".
}
);
</aui:script>
Another possible solution through Hook:
You can create a hook as mentioned by Sandeep Nair to hide the results-text but you can put a condition to check to hide only if the URL of the page is for which you want to hide this or can have a condition to check for the particular portlet you want to hide this result-text.
So it will work normally for other pages and portlet, but will hide for your page and certain portlets which you define. This is an idea and have not tried it yet, but I think it would work. You can use the themeDisplay object which is available on JSP pages to retrieve the portlet-id.
Hope this helps.
Thanks to Felix Christy for suggesting the solution through Javascript.
I thought of converting my comments to an answer for better visibility to other members of this wonderful community.
It is because you are using page-iterator in your search container. When the records exceeds the default delta the message above will be replaced by showing-x-of-y-results alongside page numbers and controls for navigating to next pages.
If you dont want this then you have to modify the jsp page using hook. The name of the jsp is showing_x_results.jspf and following snippet is what you are looking for to modify in that.
<c:otherwise>
<c:choose>
<c:when test="<%= total != 1 %>">
<%= LanguageUtil.format(pageContext, "showing-x-results", numberFormat.format(total)) %>
</c:when>
<c:otherwise>
<%= LanguageUtil.format(pageContext, "showing-x-result", numberFormat.format(total)) %>
</c:otherwise>
</c:choose>
</c:otherwise>
In order to remove that String for some specific page, please put a jQuery/javascript on the page, which will hide that particular div/span which is showing that text.
In this case, it will not be shown on that page, but it will be available and will be rendered elsewhere.
Here are the quick steps :
Go to "Manage Page" section of the desired page (page on which you dont want to show this text)
Go to javascript section add this $('.taglib-page-iterator').hide();
This will only work, if you have included jquery.js in your theme. So please do it.
At present, hook (or ext if you want an extreme solution) is the only way you can do it.
Override the showing_x_results.jspf Fragment and comment/remove what's unnecessary.
The only "properties" that are configurable through the portal-ext.properties are these (LR 6.0.5)
#
# Set the available values for the number of entries to display per page. An
# empty value, or commenting out the value, will disable delta resizing.
# The default of 20 will apply in all cases.
#
# Always include 20, since it is the default page size when no delta is
# specified. The absolute maximum allowed delta is 200.
#
search.container.page.delta.values=5,10,20,30,50,75
#
# Set the maximum number of pages available above and below the currently
# displayed page.
#
search.container.page.iterator.max.pages=25
#
# Set this to false to remove the pagination controls above or below
# results.
#
search.container.show.pagination.top=true
search.container.show.pagination.bottom=true
You can find the latest (LR 6.1GA) Search Container properties explained here: http://www.liferay.com/es/documentation/liferay-portal/6.1/user-guide/-/ai/search-container
I wouldn't recommend hiding it from the client end as it will most likely break if you decide to upgrade your Liferay Installation. Hook is a safe way out.

drag and drop in drupal 6 block

I am working on drupal. I am facing problem in block. There is no drag and drop function on the page. When i dissable javascript on my browser it show weight option to set manually, after enable again it is not showing.
can any one suggest about this type of problem. if there is any css related issue please suggest me about this
Usually, when this happens, the <?php print $scripts; ?> call in your theme's page.tpl.php is missing, so that Drupal's JavaScript files aren't being included (it's JavaScript that creates the drag and drop features). Or there is an error/conflict in your JavaScript/jQuery.
Is $scripts being printed in your theme?

Resources