Member Login

Freestyle Joomla Forums

Includes: Data

Member Login   Register

Please login or register to post on the forum

Forum Index    Board Index    Last Post   

Lawrence Fuller

Lawrence Fuller

19 October 2014, 18:09

How to

Good morning... loving Includes: Data so far but have one question --

I am creating a templated site for Animal Rescues.  So far I have used this extension to query an SQL table to give a listing of dogs with the Status of 'Available' (link to page given)

What I am hoping to do from here is to allow the user to click on the photo or the name of the animal and go to a page with further details.  These further details are kept within the same SQL table that populate the page given in the link.

How would I setup a template to accept the key of the record and then use it to populate a page with that specific animal's info?  I would normally send the key as a Post or in the querystring and then use it in the detail SQL statement.

I have a feeling that I should be able to do this but the documentation is a little sparse. I saw in another post that the Smarty Parser "... allows you to modify the SQL based on the parameters passed ..." but can't find any documentation on the Smarty Parser.

Thanks in advance!
Link showing problem http://www.artistniche.com/pixiemamasrescue/adoptable-pixies
Joomla Version 3.3.6
Freestyle Version Includes: Data Pro v2.5.0.1916
Pro/Lite Pro
Adam Clarke

Adam Clarke

20 October 2014, 17:00

Re: Click for Details

Glad you like it, its quite a complex component to get started with but can be very useful. Most the "Products" section of our site is created using Includes: Data, along with several other areas!

It turns out that a few tweaks to the component were needed to make this work. I have published a new version of Includes: Data with this required fixes. You will need v2.5.1 for this to work.

I have included a few screenshots of an example of how to do this below. It requires an Extra Template to be created for you "Single" item view.

/component/fss/?view=ticket&ticketid=4177&fileid=2435

/component/fss/?view=ticket&ticketid=4177&fileid=2436

/component/fss/?view=ticket&ticketid=4177&fileid=2437

In the template, the bulk of the link will need changing to what url you are using on your site. The ditmpl tells the system to use the extra template "Single User", and the username part just passes a variable as part of the URL.

In the SQL for your data source, there is a bit of smarty code to fetch the 'username' parameter from the URL and run different SQL accordingly.

Please let me know if you need any further help with this.

Thanks

Adam Clarke
Freestyle Joomla

message-39387-inline-image-1.png

18.2 KB

message-39387-inline-image-2.png

40.17 KB

message-39387-inline-image-3.png

25.34 KB
Adam Clarke

Adam Clarke

20 October 2014, 17:12

Re: Click for Details

Just a quick note about the smarty processing. General smarty docs can be found at http://www.smarty.net/docs/en/

For the SQL, its the resulting output that gets passed as the SQL statement.

Also, there is a bit of a security hole in the previous Data SQL. Use the following instead:

{if empty($smarty.get.username)}
SELECT * FROM #__users
{else}
SELECT * FROM #__users WHERE username = '{$smarty.get.username|mysqli_real_escape_string}'
{/if}

Thanks

Adam Clarke
Freestyle Joomla
Lawrence Fuller

Lawrence Fuller

20 October 2014, 18:15

Re: Audit Message

Fantastic!  I can hardly wait to try this out this evening.  For me, this one new feature has tremendously increased the value of an already useful extension.

Cheers!
Lawrence Fuller

Lawrence Fuller

02 November 2014, 13:32

Pixies Revisited

I tried the update and I am able to create a link on the page that goes to a specific pet... thank you for that!  But, the main template is coming up and not the extra template.  

The link created by the first pet on the page, for example, looks like this:
http://www.artistniche.com/pixiemamasrescue/adoptable-pixies?ditmpl=singlepixie&pixie_name=Andre

I created a template named singlepixie tied to the main template, Adoptable Pixies (see attachment).  

So far, I only have included the pet name on the extra template.  Though I am coming up with the right animal, the template is Adoptable Pixies and not Singlepixie.

Any ideas?

Thanks!

EDIT:  I changed the key field to the single pet lookup to pixie_id, since I could not guarantee every pet would have a different name (and most likely wouldn't!)... the actual link to the pet "Andre" would be http://www.artistniche.com/pixiemamasrescue/adoptable-pixies?ditmpl=singlepixie&pixie_id=2 and not the one I included above.

singlePixie.png

5.28 KB
Adam Clarke

Adam Clarke

05 November 2014, 09:41

Re: Click for Details

There must be something going wrong in the Includes: Data code somewhere. Could you provide admin access to your site so I can track down what is going wrong here? If this is OK, please open a Support Ticket with this information.

Thanks


Adam Clarke
Freestyle Joomla
Adam Clarke

Adam Clarke

07 November 2014, 20:08

Re: Click for Details

Found the cause of this. The ditmpl url parameter wasnt getting passed to the code when used as a content plugin (ie, is {data xxxxx}). I have uploaded an updated version that you can add the extra parameter from-url into the tag that will allow the include to pull in parameters from the url.

I have changed your article to have the following call:

{data adoptable-pixies from-url}

and this has allowed the alternate template to work. Sorry about the problems with this, there are so many ways different ways of using Includes: Data we sometimes miss things like this.

Just for information, you can use a Menu Item to link directly to a Includes: Data template instead of having to go through the content plugin. Just select "Freestyle Includes: Data" -> "Display Includes" as the menu item type, and specifying the template etc in the Dataset tab.

Thanks


Adam Clarke
Freestyle Joomla

Vote For Us!

Please vote for our software or write a review of one of our products on the Joomla! Extensions Directory