Reputation: 182
I have been using Fuel CMS to develop a website, and I was thinking of using blocks to make my pages dynamic using CMS, but I can't access any passed variables inside block.
{fuel_block(array(
'view' => 'nt_project_card',
'vars' => array(
'project_title' => 'Test Project',
'project_desc' => 'Some details about project',
'project_link' => 'projects/project1'
)))}
<img class="card-img-top" src="{fuel_var('img')}" alt="Project Image">
<div class="card-body">
<h5 class="card-title">{fuel_var('project_title', 'Title')}</h5>
<p class="card-text">{fuel_var('project_desc')}</p>
<a href="{site_url(fuel_var('project_link'))}" class="btn btn-link">Read More...</a>
</div>
Where am I going wrong? I have seen documentation (which is already very vague) and questions on forum but they didn't help either. I can only see my default value along with the rendered block.
Upvotes: 0
Views: 291
Reputation: 548
can use
<?php echo $this->fuel->blocks->render('block_name'); ?>
same as application\views_blocks files
Upvotes: 0
Reputation: 182
So it seems I don't need to use any function I can just go with the usual $variable
to use the passed variables in blocks.
Upvotes: 0