LocomotiveCMS
Discussions
Activity
Sign In
General
how to drop current_admin on liquid page
samnong
December 2011
Hi, everyone.
I'm trying to drop the name of the current_admin to liquid page. First I add the to_liquid method to account model:
def to_liquid
Locomotive::Liquid::Drops::Account.new(self)
end
and I create a account liquid drop file under the folder \lib\locomotive\liquid\drops as the following:
module Locomotive
module Liquid
module Drops
class Account < Base
delegate :name, :to => '_source'
end
end
end
end
But how to drop current_admin to liquid page? I tried the following in my index liquid, it sure no luck, because current_admin not in the "_source"
{% if account %}
Welcome - {{ account.name }}
Sign_out
{% else %}
Sign_in
{% endif %}
Thanks for any help!
Merry Christmas!
mariovisic
January 28
If you check out the lib/locomotive/render.rb file you'll see all of the variables that are available to the CMS. Just add the account to the list.
Although I can see there already is a current_admin variable available.
Add a Comment
Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In
Apply for Membership
Categories
All Discussions
235
General
135
Installation
20
Requested features
14
Problems
45
Choosing Locomotive
4
Locomotive Editor
17
Powered by
Vanilla