Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

Help (for a beginner coder)? 12 Sep 2012 06:11 #3533

  • geoffr
  • geoffr's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 68
  • Thank you received: 2
No doubt a no-brainer for some, but I'm having trouble deciphering how the Joomla code creates its urls from the data. The following code:
echo JDom::_('html.fly', array(
					'dataKey' => '_tool_id_code',
					'dataObject' => $row,									
					'route' => array('view' => 'toolsitem','layout' => 'tool','cid[]' => $row->tool_id)
					));

simply displays:
RAPP
which has a link embedded in it.

How do I echo ONLY the word "rapp" without the link?

Thanks,
Geoff

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

Re: Help (for a beginner coder)? 12 Sep 2012 18:06 #3540

  • VeCrea
  • VeCrea's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • Absolute JCook fan
  • Posts: 473
  • Thank you received: 100
It's a jDom thing.
The "route" part of the code creates the url, so maybe you should try to remove it and have something like that :
echo JDom::_('html.fly', array(
					'dataKey' => '_tool_id_code',
					'dataObject' => $row
					));
Tell me if it did solve it.
Anyway, isn't it something you could solve within the builder or with acl ? (i don't really know what you're trying to do, but it's worth checking it out.
The following user(s) said Thank You: admin

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

Re: Help (for a beginner coder)? 12 Sep 2012 21:05 #3554

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
Good catch, JDom feature to link properly.

Another good stuff, not a lot of people know (No docs ...)
'dataKey' => '<%name%> <%surname%> : phone <%phone%> '

Replace with your custom keys (leave the tag bounds <%..%> ) and see the result !!
Coding is now a piece of cake
The following user(s) said Thank You: JoomGuy

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

Last edit: by admin.

Re: Help (for a beginner coder)? 14 Sep 2012 02:06 #3584

  • geoffr
  • geoffr's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 68
  • Thank you received: 2
Thanks for the answers. The above code looks handy, but how do I use it?

I tried this ...
echo JDom::_('html.fly', array( 'dataKey' => '<%name%> <%surname%> : phone <%phone%> '));

But it returned nothing.

Thanks,
Geoff

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

Re: Help (for a beginner coder)? 15 Sep 2012 13:05 #3658

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
echo JDom::_('html.fly', array(
					'dataKey' => '<%name%> <%surname%> : phone <%phone%> '
					'dataObject' => $row
					));
BUT, do not copy/paste this code, you must understand it first.

It will return the values of $row->name, $row->surname, $row->phone, so these properties must exists for this example
Coding is now a piece of cake

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

Re: Help (for a beginner coder)? 15 Sep 2012 18:16 #3663

  • VeCrea
  • VeCrea's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • Absolute JCook fan
  • Posts: 473
  • Thank you received: 100
To push the explanation further, notice the <%xxx%> represent a row of your table and the rest is just text added between those values.
So what you put between <% and %> depends on what datatypes you added in the TABLES section of your project in the builder.
Admin, correct me if I'm wrong, but the only drawback of this method is the " : phone" you have there in your example (the text added between the values) can't be translated through language files, so you should be cautious about this.
The following user(s) said Thank You: admin, JoomGuy

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

Re: Help (for a beginner coder)? 19 Sep 2012 10:12 #3764

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
<%xxx%> represent a field, not a row, but what you explain is right.

About the languages, you can write this string (with markers) in your language file.
It becomes complex to read the source, but really opened !!!
Coding is now a piece of cake
The following user(s) said Thank You: JoomGuy

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

  • Page:
  • 1
Time to create page: 0.067 seconds

  Excellent Tool ! This tool will save you a lot of time writing the same old structure. I've used others but this is really nice for a quick start. Makes a 3 hour task a 15 minute one. Thanks for this extension
dickrundell (JED)
         

Get Started