I am trying to pass a class to an include with grunt zetzer but I am not able to take it into the include.
I mean I invoque the part
{{= it.include("common/entity-slider-hero.html", {"class" : "extraclass","link" : "http://www.optionlink"}) }}
It works fine, but how do I get the option in the include?... something like
<div class="hero-slider {it.{class}} " >
Any help is appreciated
finally I found the solution the correct way was {{= it.class}}
Related
i'm trying to display picture on laravel.
I did that : <img src="public/medoc.jpg" alt="Toxic Project">.
To be sure at 100% it is not a link problem i writed public/medoc.jpg on terminal and it's launch the picture.
I try to diplay it on the welcome view.
I have alredy tried with : "{{ asset('public/medoc.jpg') }}"
What's wrong ? thanks
The asset() helper provided by Laravel is already referencing to the public folder.
So all you need to do is :
<img src="{{asset('medoc.jpg')}}">
And Laravel will do the rest for you.
if you use asset that means you are already in public folder so no need to write public..try this one..
"{{asset('medoc.jpg)}}"
I know there are similar questions answered to this question, but none of the solutions worked for me. I have the following folder structure:
static
----calendar
--------calendar.controller.js
--------calendar.view.html
----home
--------home.controller.js
--------home.view.html
----app.js
----index.html
Inside calendar.controller.js I have created a directive for my calendar that looks like this:
.directive('myCalendar',function(){
return{
restrict:'E',
template:"calendar.view.html"
}
})
I am trying to render that calendar template from home.view.html without success.
I have this in my home.view.html:
<my-calendar></my-calendar>
On the browser it actually displays the path I am trying to make him bind (on the browser you can see "./calendar/calendar.view.html"). And I've tried changing the directive's path in many ways:
- template:"./calendar.view.html"
- template:"/calendar.view.html"
- template:"./calendar/calendar.view.html"
- template:"/calendar/calendar.view.html"
... but it still won't work. Thank you.
template:"calendar.view.html"
that is a mistake
you need templateUrl:"calendar.view.html"
instead
this is my template : http://pastebin.com/Gmdmqwxa
Whenever I add comment it is adding always to the first question on the list, even if I click on the others question 'Add Comment' button.However, the remove button works just fine for all the questions.
I think i know what it is working like that, so i thought i could use iterStat or something like that to iterate through questions, and then set th:action with iterStat, but its not working
<div th:each="question, iterStat : ${person.questions}" >
th:action="#{'/newComment/' + ${iterStat.current}}"
Maybe anyone has different idea how to fix this issue ?
I am trying to setup an ng-class in my app
I have something like this
$scope.myClass = 'class-A';
do something hereā¦
$scope.myClass ='class-B';
do something here
$scope.myClass ='class-C';
html
<div ng-class="{myClass}"></div>
The above codes work. The problem is when I add additional one, it doesn't work anymore.
<div ng-class="{myClass, 'class-cool':openDialog}"></div>
I am getting
Token ',' is unexpected, expecting [:] at column 15 of the expression
They work if I use them separately but not together. Can anyone help me about the issue? Thanks a lot!
You can do like this. myClass will always be set since true will always be true.
<div ng-class="{myClass:true, 'class-cool':openDialog}"></div>
I am trying to get the html of top.links using the following ways:
$blockHtml = Mage::getModel('cms/block')->getBlockHtml('top.links')
$blockHtml = Mage::app()->getLayout()->getBlock('top.links').toHtml()
$blockHtml = Mage::getSingleton('core/layout')->getBlock('top.links')->toHtml()
None of above is working for me, how I can do this?
Thanks.
UPDATE
I used
$layout = Mage::getSingleton('core/layout');
$block = $layout->createBlock('page/html')->setTemplate('page/html/top.links.phtml')->toHtml();
With the help of this question Add Top Links on condition basis in magento but still no luck. During this try I found that the use of top.links.phtml is deprecated, any idea which template should I use for the links?
I think there is some dependency for top.links.phtml file, that's why it isn't working, when I tried to get footer.phtml it worked perfectly with above method.
Just like the op, I tried many ways without success. The following simple line finally does it:
<?php echo $this->getLayout()->getBlock('top.links')->toHtml(); ?>
Wow! I was able to find a correct answer finally :) Load block outside Magento, and apply current template
So by following the the above question's answer, I did this to get generated top.links
$layout = Mage::app()->getLayout();
$layout->getUpdate()
->addHandle('default')
->load();
$layout->generateXml()
->generateBlocks();
echo $layout->getBlock('top.links')->toHtml();
If you have created CMS block named 'block_identifier' from admin panel. Then following will be code to call them in .phtml
<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('block_identifier')->toHtml();
?>
Please,used the belowCodes.This will be working
echo $this->getLayout()->getcreateBlock('page/template_links')->toHtml();