Display only first module of a position - joomla2.5

Is there a way to limit <jdoc:include type="modules" name="user1" style="xhtml" /> to display only the first published module of this position?
It should respect the ordering present in Module Manager, the purpose of this is to show a certain module only if the date is valid and if it unpublishes because of the date, the next valid module is shown without needing assistance from a user.
Thanks in advance.

There's a very easy way to do that. Install Advanced Module Manager and you can easily configure the module position to display the correct module.

Related

How do I access the current order id in opencart?

How do I access the current order id in opencart and put it in a variable? I am working in a new file, which did not come with the standard opencart install.
The closest I have been able to get is the following code, which doesn't work:
<?php
session_start();
$order_id = $this->session->data['order_id'];
?>
Thanks in advance.
The order ID isn't set until the customer gets to the final page of the checkout process, so you won't be able to get it before that. For your code above, you can't use $this->session->data['order_id'] unless you are in an opencart class, therefore you would need to use $_SESSION['order_id']

How to use module in to my menu item

I have an custom module for search location.Now i want to put this module in to one of menu item content page. I am using joomla 2.5. Any way how to do it?
I have solve it by use the {loadposition} method
For using the module into your content page go to extension manager->plugin manager.Then search for Content - Load Modules plugin enable it(if disable). Then set style to no wrapping(raw output).
and then to your article manager and insert this line where you want to display your module
{loadposition myposition} //where myposition is the position of your module

Using modules in Joomla K2 Sub-templates

I have a quick question connected with my little knowledge of Joomla\K2. I'm using subtemplates to create different layouts for different pages. When I declare module position on sub template:
<jdoc:include type="modules" name="position-7" />
Nothing happens. I've tried the same code for main template file and it worked, but seems like it's not parsed for sub-templates. Am I right? How can I include modules into sub-templates then?
thanks in advance,
Michael
jdoc tag only works in joomla core template. If you want to load modules of specific position in your k2 subtemplate write the following code at your desired location in that subtemplate.
$module = JModuleHelper::getModules('xxxx');
// xxxx is any virtual position, no need to create it anywhere.
echo JModuleHelper::renderModule($module[0]);
replace xxxx with your desired position name.

Can YQL Open Data Tables make use of multiple URL fields that its XML scheme seems to support?

As I experiment more and more with making my own Open Data Tables for YQL I find what might be some gaps in the documentation. As I'm a hands-on learner and like to understand everything I use I probe these gaps to try to learn how everything works.
I've noticed that in the XML format for Open Data Tables, there is a <urls> "array" which usually contains just a single <url> element though sometimes there is no <url>. Here's the beginning of a typical ODT XML file:
<table xmlns="http://query.yahooapis.com/v1/schema/table.xsd" https="true">
<meta>
<author>Paul Donnelly</author>
<documentationURL>http://developer.netflix.com/docs/REST_API_Reference#0_52696</documentationURL>
</meta>
<bindings>
<select itemPath="" produces="XML">
<urls>
<url env="all">http://api.netflix.com/catalog/titles/</url>
</urls>
But I can't seem to find in the documentation whether it can ever contain more than one. I can't find any examples that do but when I try adding more than one everything works and no errors are thrown, though I also can't find any way to access the <url> elements beyond the first one.
Is there any use for the url/urls fields being an XML array? Is there any way to make use of more than one url here? Or is it just a quirk of the format that has no real reason?
Is there any use for the url/urls fields being an XML array?
Is there any way to make use of more than one url here?
The <url> elements can have an env attribute. This env attribute can contain all, prod, int, dev, stable, nightly, perf, qaperf, gamma or beta.
When the table is executed, the current environment (the YQL environment, not the more familiar environment file) is checked and the first matching <url> (if any) is used. If no matching env is found (and there is no all, which is pretty self-descriptive) then an error will be issued; for example, "Table not defined in this environment prod".
Note that for public-facing YQL, the environment is prod; only prod and all make sense to be used in your Open Data Tables.
Or is it just a quirk of the format that has no real reason?
Not at all.
I assume that this information is "missing" from the online documentation purely because it is only useful internally within Yahoo!, but equally it could just be another place where the docs are somewhat out-of-date.
Finally, none of the 1,100 or so Community Open Data Tables specify more than one <url>, and only a handful (55) make use of the env attribute (all using the value all).

how to add a new modulo position on a joomla template?

i'm using a joomla template called decayed and it doesn't have the right position, only the left one and nothing more.
i would like to add a right and a button positions on that template. how can i do it?
cheers
Assuming you're using joomla 1.5, go into the template directory (/templates/someTemplateName/). I don't know anything about this theme, but if it follows the standard scheme for a joomla template, then modify these two files:
1) index.php
<jdoc:include type="modules" name="myModulePosition" />
Add that wherever you want your module to appear in the template (and substitute "myModulePosition" for what ever you want the module position to be named).
2) templateDetails.xml
Find the xml tag , should probably look something like this:
<positions>
<position>left</position>
</positions>
And add a new tag with your new position, such as:
<positions>
<position>left</position>
<position>myModulePosition</position>
</positions>
That way, your module position will show up in the list of available positions when you're adding/modifying modules.
scott solution may not work at all.
I simply do this by going to DB find module in #__modules table and add in the field "position" the name of desired position, It is hard way but it work's well