Could someone please help me. I'v read the user guide and all the Forum discussions - and now I'm really confused.
I can't get anything to work.
What I want to do is display/edit data from a module in the web side of the site - not in admin.
So according to the manual, I must put the following code in a Page.
{fuel:module:articles var="my_articles" find="all"}
{my_articles}
{article.title}
{/my_articles}
When I try to view this page I get the following error:
An Error Was Encountered
Compilation error at line 75 in "string:" : Parse error in "fuel:module:articles var="my_articles" find="all"} {my_articles} {article.title} {/my_articles}
Any help would be appreciated.
Thanks
Comments
http://www.getfuelcms.com/user_guide/parsing/
http://www.dwoo.org/
{$articles = fuel_model('articles')} ?> {foreach($articles article)} {$article->title} {/foreach}
If it is just a normal view file then you can use normal php syntax like so:
<?php $articles = fuel_model('articles'); ?> <?php foreach($articles as $article) : ?> <?php echo $article->title; ?> <?php endforeach; ?>
What I normally do is create the static view file and then import into the CMS which will take care of most, if not all the templating syntax conversion.
Where did you see that templating syntax mentioned above?
{$articles = fuel_model('articles')} ?> {foreach($articles article)} {fuel_edit($article->id, 'Edit Article', 'articles')} {$article->title} {/foreach}
http://www.getfuelcms.com/user_guide/general/inline-editing
http://www.getfuelcms.com/user_guide/helpers/fuel_helper (fuel_edit and fuel_var functions in particular)
As to where I got the example code above, it was -
Users Guide Home > Modules > Simple modules > The Views > Form View.
I have another question ;
Is there a way of inserting new records into the module from the site as apposed to Admin ?
I'll update that graphic to show the use of the dwoo syntax (that was a screenshot of a test page we used for an older templating syntax.
{$articles = fuel_model('articles')} ?>
{foreach($articles article)}
{fuel_edit($article->id, 'Edit Article', 'articles')}
{$article->title}
{/foreach}
I therefore can't try the 'create' ? I have tried to find examples in the User Guide, following the links you sent me, but to no avail.
Thanks
Roly
Apologies.
I just tried
<?php $hotspots = fuel_model('hotspots'); ?>
.
.
foreach($hotspots as $hotspot):
<?=fuel_edit($hotspot->id, 'Edit Hotspot', 'hotspots');?>
<?=$hotspot->hotspot ?>
.
.
<?php endforeach; ?>
I see the obviously echoed data and the generated html shows several spans related to editing just after the body tag and a span with class="__fuel_marker__" that looks completely logical for each item I want to edit
However ---
I never see the fuel edit icon !
Any thoughts on what I might be doing wrong?
Thanks in advance ...
Thanks
I also added the name of the module explicitly as a permission (even though I'm currently testing as super admin) ... the problem did not go away
Does not help.
Sigh