Keyword

Forcing K2 page IDs

  • Paul Squires
  • Paul Squires's Avatar Topic Author
  • Offline
  • New Member
More
11 years 11 months ago #106098 by Paul Squires
Forcing K2 page IDs was created by Paul Squires
Hi all,

I have a K2 issue which I hope that someone can help with...

We have a solution that uses a Joomla multisite component and K2.

The content is split, but the image directories are shared. So, when site A creates a content item and uploads an image, that image overwrites the one if site B has a content item already published with the same item ID.

So, is it possible to change the format or numbering - or anything! - regarding K2 item IDs? For example, I'd like site A to start at zero and B to start at 1000.

Or, some kind of function where the user can write in their own item ID.

Thanks in advance,
Paul

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

More
11 years 11 months ago #106099 by william white
Replied by william white on topic Re: Forcing K2 page IDs
Since itemid is an autoincrement type field in the table, the only thing i can think of is to insert 999 blank items into a scratch category in one site

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

  • Paul Squires
  • Paul Squires's Avatar Topic Author
  • Offline
  • New Member
More
11 years 11 months ago #106100 by Paul Squires
Replied by Paul Squires on topic Re: Forcing K2 page IDs
Hi William,

Good timing! I came to pretty much the same conclusion. Here's what I did

1. Create a new content item called "Test item 10000"
2. Go into PHPMyadmin and change the ID of this item to 10000

I then added a couple of new items in K2 and they correctly incremented as 10001, 2, 3 and so on. Deleting item 10003 and then creating a new item correctly gave it the ID 10004.

There's obviously a lot of numerical space between the last of the "old" IDs (350) and the new (10000), presumably this is not a problem? The database won't collapse? ;)

Anyway, does the above seem OK with you? It seems to work...

Cheers,
Paul

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

More
11 years 11 months ago - 11 years 11 months ago #106101 by william white
Replied by william white on topic Re: Forcing K2 page IDs
As always, should you or any of your IM force be caught or killed, the Secretary will disavow any knowledge of your actions. Good luck, Jim. This tape will automatically self destruct in 10 seconds. www.youtube.com/watch?v=mWGeRgFa-hI

If its working its working. The fact that the sites are in a multi site configuration, is complicated to start with and even more if they are sharing the same tables. Have you already upgrded them to the latest joomla 2.5.x version?

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

  • Paul Squires
  • Paul Squires's Avatar Topic Author
  • Offline
  • New Member
More
11 years 11 months ago #106102 by Paul Squires
Replied by Paul Squires on topic Re: Forcing K2 page IDs
Hi William,

Thanks - and I liked the Mission Impossible reference :lol:

We inherited the multisite configuration from a preceding agency, but have upgraded it to J2.5. The K2 tables are in fact different for the two sites - they just share the same image directory. That's how the clash of item IDs and images came up.

Starting new items from 10000 seems to be working fine - K2 is happily auto-incrementing on the site that we have deployed the changed to.

Thanks again.

Cheers,
Paul

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


Powered by Kunena Forum