Follow up quesiton re $Form

<%- if @topic_view.topic.tags.present? %>
<%= t 'js.tagging.tags' %>: <%- @topic_view.topic.tags.each do |t| %> <%= t %> <%- end %>
<% end %>

Actually a follow up question now I can see the form… as the instructions say most sites nly ever have a single template (Page.ss) is there an example somehwere I can read of adding $Form to my main template such that it only prompts when an editor visits? Or associate it with another URL such as /edit ? I assume that if most sites only have one template, $Form is usually placed in the main template and there is a best practice way to invoke the login for administrators? Is there an example? (I am guessing I would do a logical test for a GET parameter or something?

Also the setup process did not provide an opportunity to create an account so I actually don’t have a password to use. Just to try it out, I hacked LoginHandler.php to bypass the check and yes, I got past the login form, but I did not see the CMS. It just showed an error page from the /admin.

So I have a few questions:

  1. how to add a logiin to the Page.ss so it only prompts me
  2. how to create a password for admin
  3. after I log in, what else do I need to do to make it go to the CMS?

Thanks

You can safely add the $Form to your main template, it will only do something when it needs to (eg. when a user login is required). The rest of the time it won’t output anything.

You should be able to gain access to the CMS by visiting: http://example.com/admin If you’re not logged in, you should be redirected to the login form. Use the default details you added to the env file. This should log you in, and you should see the CMS. On the left, there’s a ‘Security’ section where you can add users to the system.

You shouldn’t need to mess around with any of the core code to make this work, so roll back the changes you made to the login handlers and you should be good to go.

you champion! spot on all good and I have a CMS!! (after hacking the DB to remove my lockout after all that mucking around! :wink:

1 Like