-
geoffr
-
-
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.
Thanks in advance,
Geoff
|
|
-
admin
-
-
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
|
-
geoffr
-
-
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
|
|
-
admin
-
-
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.
|
-
geoffr
-
-
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
|
|
-
BTB300
-
-
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.
|
-
geoffr
-
-
Offline
-
Senior Member
-
- Posts: 68
- Thank you received: 2
-
Karma: 0
-
|
Thanks BTB300 - do you have that link? Thanks!
|
|
-
admin
-
-
Offline
-
Administrator
-
-
Chef
- Posts: 3711
- Thank you received: 987
-
Karma: 140
-
|
|
Coding is now a piece of cake
|
-
BTB300
-
-
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 !
|
|
-
geoffr
-
-
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
|
|
-
BTB300
-
-
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 following user(s) said Thank You: admin
|
-
JoomGuy
-
-
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 following user(s) said Thank You: admin
|
-
admin
-
-
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 following user(s) said Thank You: JoomGuy
|
-
geoffr
-
-
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
|
|
|