2

I am using the Smart Admin Theme Ajax version in a project, and I cannot figure out how template data gets added to the theme.

  • There is a main index view and
  • Page sections stored inside the ajax folder of the theme

When I click on menu link, it just loads the section in to the div#content which is the main body. The application has different roles and each one has access to different resources. I would like to do the same with the menu items. If a user is in role X, then certain menu items are either included or excluded.

My Question's:

  1. How would i go about achieving this?

  2. How do I template data using JavaScript?

    (Are there libraries which will make this easier and does Smart admin already ship with a feature that will help me template the data?)

Community
  • 1
  • 1
Rohan
  • 13,308
  • 21
  • 81
  • 154

1 Answers1

0

You should have a main file which should be loaded first and have all the menus, header and footer. You should generate this file according to the role of the user and show only authorized menus.

Then you should have all your inside files without any header or footer that will be loaded into the main files div#content. You should also do a security check in each inner file.

Huseyin Yagli
  • 9,896
  • 6
  • 41
  • 50