Hot answers tagged

6

Joomla uses value of name attribute along with a prefix (prefix_valueOfnameAttribute) to generate Id of the field in case there is not id attribute provided. If you add id attribute in your xml then this provided id is automatically gets added to the form field. prefix mentioned above is the argument which you pass while getting Form instance.


4

That practice would actually be terrible for SEO. You would be hurting your search content by regularly replacing content on the same id. Aside from that, even if you did reuse the ids, they would still continue to get larger,but at a slower rate. This is because you wouldn't have access to ids that are smaller than the last remaining id. Ex: if you have ...


4

The first problem is that you're using joomlausers->id which doesn't look correct. It should be $joomlausers->id (with a $ at the beginning). Secondly, loadObjectList() returns an indexed array of PHP objects, so I don't believe in_array will work with this. Instead, I'd suggest using $db->loadColumn(), which will return an array of all userid's, ...


3

I don't think it is very direct to filter the result set when sql is perfectly qualified to do such logic. As Lodder corrected, you also need to use setQuery(), fix your missing $, adjust your result set generating method call, and improve your redirect technique. I've included some helpful diagnostic lines to help you to understand the query that is being ...


3

In both cases you should access the article's object id property. By the way, do note that JRequest is deprecated. For the article, in your article template you can add next to the article's title the: echo $this->item->id; For the category blog title, we are actually talking about the same (as the blog layout is looping through the articles of a ...


3

If the input requires an ID you should place it in the .xml also, e.g: <field name="report" type="foreignkey" class="inputbox" id="subscriptions-report" label="COM_SUBSCRIPTION_FORM_LBL_SUBSCRIPTIONS_REPORT"


2

I don't know what the documentations says, but the truth is that I haven't see the menu item id in the details page for a while, although it used to exist there ( I remember it in Joomla 2.5, below the template style field). However, you can always find the item id of the menu item you are editing, from the url, at the browser's address bar. The url will ...


2

There is a relevant discussion here, but in short it just concludes that using the jdatabase insertid method is just as rubbish as mysqli_insert_id. Joomla DB Insert, how to get last inserted id? The trick is to do a select using fields that you already have from the insert query, eg. get max id & match the userid, or any other fields that you might ...


2

This is actually a pure MySQL question which should be titled "How to Alter a MySQL column". There is nothing different or special if the database is used for a Joomla site. So simply to have this part of the question answered, a SQL statement like below would do it: ALTER TABLE `YOUR_DATABASE`.`#__users` CHANGE COLUMN `id` `id` VARCHAR(50) NOT NULL ; ...


1

You could use something like the following: jQuery(document).ready(function($) { var querystring = 'affiliate=12345'; $('a').each(function() { var href = $(this).attr('href'); if (href) { href += (href.match(/\?/) ? '&' : '?') + querystring; $(this).attr('href', href); } }); }); ...


1

This plugin does the job, order numbers are customisable through this - http://extensions.virtuemart.net/vm-orders/order-number-plugin-detail


Only top voted, non community-wiki answers of a minimum length are eligible