how to drop current_admin on liquid page
  • 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!
  • 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.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!