Welcome, Guest
Username: Password: Remember me

TOPIC: Constructing the URL for the data item page

Constructing the URL for the data item page 03 Sep 2012 06:53 #3355

  • geoffr
  • geoffr's Avatar
  • Offline
  • Senior Member
  • Posts: 68
  • Thank you received: 2
  • Karma: 0
I am not a programmer and JCook has been great so far. I'm not afraid to go under the hood but I have difficulty finding my way around... Is it possible to do the following? --

I need the flexibility to point to a record in my database by a field OTHER THAN the basic record ID, as the data for our component is repopulated when we update, and the record ID (`cid`) changes for the same item after an update.

Is there a way to construct the page URL so that it references a different field such as `tool_id` instead of the usual `cid`? If so, may I ask how? I'm not sure where to start. :blush:

Thanks in advance,
Geoff
The administrator has disabled public write access.

Re: Constructing the URL for the data item page 04 Sep 2012 05:29 #3367

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
Nothing to do with the url.

I mean, it is secondary.

First of all, you must change your query string in the item model. It have been spoken here many times.
(And in V2.0, the query construction is much more easy to change)

Then, if you want an url param, just catch it in the model to construct the previous query.
Coding is now a piece of cake
The administrator has disabled public write access.

Re: Constructing the URL for the data item page 04 Sep 2012 05:40 #3369

  • geoffr
  • geoffr's Avatar
  • Offline
  • Senior Member
  • Posts: 68
  • Thank you received: 2
  • Karma: 0
Thanks admin.

I know that a url parameter can be gained in PHP from myVariable = $_GET["myVariableKey"], but I don't know where and how to "catch it in the model" or how to construct the URL so that it is created properly in the MenuItem admin. ...is it simple enough to explain? where and how I do this?

thanks!
Geoff
The administrator has disabled public write access.

Re: Constructing the URL for the data item page 04 Sep 2012 05:58 #3370

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
Easiest, but deprecated :
$var = JRequest::getVar('var','default');

Now, the right use is : (V2.0 ;-) )
$jinput = JFactory::getApplication()->input;
$var	= $jinput->get('var', 'default', 'STRING');
last param is a filter against injections see the possible values in the API
Coding is now a piece of cake
Last Edit: 04 Sep 2012 05:58 by admin.
The administrator has disabled public write access.

Re: Constructing the URL for the data item page 04 Sep 2012 06:04 #3371

  • geoffr
  • geoffr's Avatar
  • Offline
  • Senior Member
  • Posts: 68
  • Thank you received: 2
  • Karma: 0
Thanks again - much appreciated! Holding my breath for V2! ... will I survive? ;-)

Cheers,
Geoff
The administrator has disabled public write access.

Re: Constructing the URL for the data item page 26 Sep 2012 12:56 #4029

  • BTB300
  • BTB300's Avatar
  • Offline
  • Moderator
  • Posts: 415
  • Thank you received: 132
  • Karma: 47
@geoffr
after i did some testing for admin I have a way to possibly do what you want
and i believe the redirect code is now working

www.j-cook.pro/forum/18-closed-tickets/3...mit=10&start=20#4001

This post shows how to
- pass multiple values - (outside cook)
- pass value other than the current ID - (outside cook)

Hope it helps
BTB300
Last Edit: 30 Sep 2012 02:26 by BTB300.
The administrator has disabled public write access.

Re: Constructing the URL for the data item page 26 Sep 2012 20:41 #4042

  • geoffr
  • geoffr's Avatar
  • Offline
  • Senior Member
  • Posts: 68
  • Thank you received: 2
  • Karma: 0
Thanks BTB300 - do you have that link? Thanks!
The administrator has disabled public write access.

Re: Constructing the URL for the data item page 26 Sep 2012 20:45 #4043

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
Coding is now a piece of cake
The administrator has disabled public write access.

Re: Constructing the URL for the data item page 26 Sep 2012 21:01 #4044

  • BTB300
  • BTB300's Avatar
  • Offline
  • Moderator
  • Posts: 415
  • Thank you received: 132
  • Karma: 47
Sorry Geoff,
Forgot to paste it (24 hours with no sleep i guess will do that)
At least Admin is on the ball !
The administrator has disabled public write access.

Re: Constructing the URL for the data item page 22 Oct 2012 04:06 #4688

  • geoffr
  • geoffr's Avatar
  • Offline
  • Senior Member
  • Posts: 68
  • Thank you received: 2
  • Karma: 0
Thanks for your help so far on this.. but I'm struggling to find some straight forward instructions on how to retrieve records using parameters other than the CID, e.g. a combination of ToolID and Number.

Together these keys will filter the result I need (and allow for changing cids since the data gets reloaded regularly).

Is anyone able to provide some clear instructions -- is this something I do in Cook or do I need to edit the component files? If files, which ones?

Many thanks.

I haven't started using V2 yet, as I understand it has bugs.... is that still the case?

thanks,
Geoff
The administrator has disabled public write access.

Re: Constructing the URL for the data item page 23 Oct 2012 19:49 #4701

  • BTB300
  • BTB300's Avatar
  • Offline
  • Moderator
  • Posts: 415
  • Thank you received: 132
  • Karma: 47
geoffr wrote:
I haven't started using V2 yet, as I understand it has bugs.... is that still the case?
With out bugs the world would not move ahead...
If we all waited till all the "bugs" are ironed out we would all be waiting a very long time...

Unsure about V2.0?
Try it and see...
Help V2.0 become stable by reporting any issues...

No wonder your lost "1.5" my post was for Cook 2.0/ Joomla 2.5 - redirects are treated differently

Move to 2.0 then I may be able to help... anyhow let me know when you have tried it on 2.0/2.5 build

Happy to help when I get back... After Halloween
Last Edit: 23 Oct 2012 20:00 by BTB300.
The administrator has disabled public write access.
The following user(s) said Thank You: admin

Re: Constructing the URL for the data item page 24 Oct 2012 07:45 #4705

  • JoomGuy
  • JoomGuy's Avatar
  • Offline
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
  • Karma: 64
Hi @geoffr,

Everything that @BTB300 said is correct, developing with the software is really the only way that we can help to stabalise it and resolve any issues/bugs because there are so many variables in the multitude of uses of cook and development and server environments etc...

To specifically answer any doubts you may have relating to bugs in Cook V2.0, the number of new tickets generated specifically relating to version 2 has been diminishing over recent weeks. Also, I'm sure that there are only a few things for admin to do to take it out of beta and make it fully-production ready.

I would also add that, with an ever evolving service that's so responsive requests for additional functionalities, there will always be bugs. Therefore, we as users, are all important to the development and testing process.

Lastly, V2.0 rocks + you are far more likely to get issues resolved as I believe that no further issues will be addressed in V1.5.

Hope this helps and that you enjoy v2!!!

Gez
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!
The administrator has disabled public write access.
The following user(s) said Thank You: admin

Re: Constructing the URL for the data item page 24 Oct 2012 07:56 #4708

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
V2.0 is still in beta, because the filters parts are still in dev.
It will handle more functionalities, and be handled better, nicer.

I want also to support for 3.0 in this 2.0 final release, and hope this in cross-version for the same generated component. (J! 2.5 / 3.0)

This is why it take time.
(Do not want to release a new version now, not handling 3.0)

I mean it is not really finished yet. Cook framework rewrite is almost finished.
But almost all issues have been fixed, don't worry.

If you encounter some issues, they cannot be on the application layer (MVC). You can only experiment some Regex, JDom or displaying problems. MVC is 99.9% stable now. (never 100%)

Thanks BTB300, thanks audibleid
Coding is now a piece of cake
The administrator has disabled public write access.
The following user(s) said Thank You: JoomGuy

Re: Constructing the URL for the data item page 01 Nov 2012 05:25 #4873

  • geoffr
  • geoffr's Avatar
  • Offline
  • Senior Member
  • Posts: 68
  • Thank you received: 2
  • Karma: 0
Thanks BTB300, Gez, and Admin for your excellent replies. Cook has been fantastic, and the support very good. I wasn't sure of the status of V2, so thanks for clarifying.

Please let us know when you feel V2 is ready for production. I have had to make some customisations to my scripts, so reluctant to start afresh with a new system, though also want to think of the future. V2.0 might be unavoidable for that reason.

Many thanks,
Geoff
The administrator has disabled public write access.
Time to create page: 0.114 seconds

Get Started