GraphicRiver

Gantry Framework - New Feature

40 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 2-3 years
  • Sold between 1 000 and 5 000 dollars
  • United Kingdom
oscardog says

I am hoping someone here has some experience using Gantry (it’s my first time!) and it’s going fairly well… however I can’t seem to create a new feature.

I’ve created the fields in the template options XML file, they appear fine and I can save them fine (they can be seen at http://pastebin.com/Rycnd1Kh ). I’ve created a file and uploaded, yet in the position specified nothing is shown. The feature file’s content can be seen at http://pastebin.com/ZJDLN58F

I can’t really see what I’m doing wrong! If I put a die() call in the top of the feature file it dies, however it just refuses to render anything in the position specified. The position is definitely used in the theme, so it’s not that either!

On a side note, the framework seems nice… although it’s severely lacking in documentation. Even creating a new feature, their tutorial is inaccurate and lists wrong files!

Thanks in advance :)

7 posts
  • Exclusive Author
  • Elite Author
  • Has been a member for 3-4 years
  • Bought between 50 and 99 items
  • Europe
  • Most Wanted Bounty Winner
  • Sold between 100 000 and 250 000 dollars
7Studio says

Hello Oscar,

Are you trying to add your new feature to Joomla or WordPress theme?

Regarding to your code,

You have added toogle switcher (on/off) in your XML , but it is missing in your feature, secondly you should to declare gloabl Gantry after your function render.

This should work ;)

http://pastebin.com/cS6DA1KT

You should take a closer look at code of others features stored in Gantry library, this should help you in future ;)

Good luck!

Tomek 7Studio

40 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 2-3 years
  • Sold between 1 000 and 5 000 dollars
  • United Kingdom
oscardog says

Thanks for the reply! This is on Joomla btw.

Unfortunately, that didn’t work :( I noticed in other features there is no check to see if it’s enabled so I didn’t think that would be required.

I tried the code, but it didn’t work either… I can PM you a link if it makes it easier. I added the line:

if ($this->get('enabled')) { die('ARGH'); }

To test it, and it doesn’t die… if I put a die() above the class it kills the script so the feature is being processed… it’s just not outputting anything!

Any ideas?

Thanks again in advance :)

40 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 2-3 years
  • Sold between 1 000 and 5 000 dollars
  • United Kingdom
oscardog says

Sorry for double post but I can’t edit anymore… I think the problem is the layout section. In the footer section it only has 3 positions listed. If I change it to 4 and save, it reverts to 3… if I force it shows 4 but makes one position span two blocks.

That might be the issue? If so… any ideas?

7 posts
  • Exclusive Author
  • Elite Author
  • Has been a member for 3-4 years
  • Bought between 50 and 99 items
  • Europe
  • Most Wanted Bounty Winner
  • Sold between 100 000 and 250 000 dollars
7Studio says

Hello Oscar,

I tested suggested modifications and on my test site it works without any problems, what about global $gantry; ?

If you wish you can send me PM and I can try to help or take a look at your feature ;)

Tomek

40 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 2-3 years
  • Sold between 1 000 and 5 000 dollars
  • United Kingdom
oscardog says

Just to let everyone know that 7Studio fixed my problem, I hadn’t named the feature file the same as the fieldset in the Gantry options!

by
by
by
by
by