So I have few articles in my menu which are for registered users only. I want them to be visible for everyone but if the user is not logged-in once he clicks on the menu I want him get redirected to the login page..
I saw this tutorial: Auto redirect guests to login but it seems outdated, in joomla 3.3 I can't find any "alias" menu item type.
Is there any alternative for that?
Iam using Joomla 3.3.1 with Community Builder.
-Thank you.
There are two ways you could do this really. One is through code and the other is through the administrators panel. I'm assuming based on the question you are interested in the back end solution.
This involves creating two unique menu items with the same name (alias' would need to be different). One which is only visible to logged in users, which points to the component view desired. The second menu is only visible to guests, and will point to the user log in component view with a redirect url set to component view you wish them to be redirected to.
I attached a link below to an article explaining how to only show menu items to guests and have them hide when users are logged in.
http://docs.joomla.org/How_do_you_hide_something_from_logged_in_users%3F
Related
I've been trying to customize my Wordpress Dashboard based on the user roles. For ADMIN, he has all the menus showing up in his dashboard menu:
Now I also have a user for whom I want only two menu items to show up, ie. Users and Upload Document, something like:
I tried Adminimize and Admin Menu Editor, but both doesn't do the intended task. Can anyone please suggest a way/Plugin to achieve this?
Go on user profile and give permission which you want to do it.
User >> all user >> select user >> and find list of role(this role has some permission.).
You can use the following plugin to have control on your admin menu and you can customized it based on your user roles
https://wordpress.org/plugins/client-dash/
Its really easy to use. Just Install it and Go to Settings – >Client Dash. The second tab will be Menus. Go there. Where it says “Select a menu to edit”, click in the dropdown and select the role you would like to customize the admin menu for. Then click on the Select button.
Ensure that “Import role’s existing menu items?” is checked and hit the Create Menu button. This will show a progress bar briefly as the menu that the selected role is currently seeing is imported. This way you don’t have to start from scratch but can easily modify what users with this role are already experiencing.
You can even add and delete menu items.
Hope you will find it helpful.
I am a novice in joomla. Now I use joomla to make a website , and I need the the website first page is a login page(login form) , only users registered will see other pages.(like joomla admistrator)
I have looked for others similar articles,
change default joomla login page,
but I still have a little confused,
my template default entry is index.php and it has other associated components and menus.
How to set the default page is login?
and I also know that I should setting up access level of all my menu items as registered.
Will you have any good suggestions?
Thanks!
a:
You could use the lockdown feature of Joomla usually used for closing the site.
System > Global Configuration > tab - Site
Site Offline = Yes
Then save and logout and look at the front of your joomla site. You will just see a login box which you may want to style.
This is a little of a hack way to do it quickly
b: this is the suggested way
You should mark all your menu items with the Access : "Registered"
Then make a second home page and mark this Access : "Guest"
You then put any content you like on this new page and a login module box.
This way people not loged in will see the Guest page and all when logged in will see Registered pages. For example if you had a menu on the page all the links will now show in the menu when logged out they did not, as Guest does not have permission.
Is this what you want?
I am using WooCommerce to build a e-commerce website. The business broadly has a few different types of users to get a variety of tasks done. The types are given below;
1) Administrators
2) Distributors
3) Customers
I could achieve the above with the given pre built user types that woocommerce provides.
What i aim to do is to display specific pages depending on who is signed in. Obviously, the three have their own tasks that they need to carry out on the website.
Here for example, I would want the Administrators to view a few extra page in the menu bar.
where as, customers will have their shopping catalogue to view and carry out their checking out experience as built with woocommerce.
I have had a look around different plugins that could possibly achieve this, but couldn't find any yet.
There are many ways to accomplish this task. One way would be to create a page and a page template, that redirects to another page, based on the user's role. Then those pages could re-direct if a user of an invalid role tried to access them. So the do_somthing.php page could redirect to the admin_do_somthing.php, distributors_do_somthing.php and customers_do_somthing.php, and each of those 3 would throw and error or re-direct to the home page if accessed by a user, or anonymous HTTP request, with a different role.
Keywords to lookup: "Worpress pages" "Wordpress templates" "Wordpress user roles" "wp_redirect()"
I have researched for this solution all month but I didn't get the right answer for my page. Please take a look and give me suggestions.
I have the admin page and the view is Dashboard.
I have tables are Staffs, Customers, Comments, Contacts....
I created these page to show data on view successfully for each of them.
NOW, I want to make the dashboard page to view each 5 top new Staffs, Customers, Comments....were being added to system. The summary page. My Dashboard page will be my main page (when access the domain, it will direct to dashboard page).
My question are:
Where should I create the Dashboard page in?
How can I take the data from Staff Controllers, Customers Controller....in the dashboard page. Dashboard page is not include in view of these above controllers.
I use cakephp 1.3
Please give me the best suggestion for this. Thank everyone much !
First of all it depends upon the way you wanna go ahead:
1) Where should I create the Dashboard page in?
Its totally upto you where you want to create the page, but it should ideally be the page to be redirected after the admin login.(BTW its a foolish question to be asked.)
2) How can I take the data from Staff Controllers, Customers Controller....in the dashboard page. Dashboard page is not include in view of these above controllers.
You can do that in 2 ways:
a) Create common functions for these in their respective model and just call those into your single function created for dashboard.
b) Create functions in their respective controller and import the controller and use these methods in the dashboard function(But avoid this approach as long as you can as it will load unnecessary controller class files).
Hope it helps you.
In Joomla prior to 1.6 i could set a menu-item to public, and its contents: an article for example to registered.
This lead to a situation where people could see the link to an article in the menu when not logged in, but got a login component whenever they clicked it. And after that they saw the article.
In 1.7 these same actions lead to a situation where when I click the link the component screen just stays empty.
How do I get registered articles to show a login screen when the front end user is not logged in with sufficient rights? It was soo easy before and I can't seem to get it to work now.
Im gonna answer my own question, because Im sure people will need this in the future, and my solution only involves a few rules of extra code and then you can set every article etc... to Registered and you'll see a login field when a user is not logged in.
In your templates index.php place this near the top, it gets your article's access level.
$article =& JTable::getInstance("content");
$article->load(JRequest::getVar('id'));
$cAccLevel = $article->get("access");
Then add a module position above your component, and only show it when your needed access level is > 1
<?php if($cAccLevel > 1): ?>
<jdoc:include type="modules" name="LOGIN_MODULE_POSITION" />
<?php endif; ?>
Then add a login module in your module manager to LOGIN_MODULE_POSITION.
Voila... no routing needed etc... everything works out of the box, I chose to style away the logout box and action field like this:
.logout-button,
.actions{
display:none;
}
Good luck!
Create a new menu from menu manager, say it is named "hidden
menu".
Add any menu items that will be accessible only to registered
users.
Set the required access levels of these menu items ("Special" in this example, but it could also be "Registered"). Do NOT create a
module for the "hidden menu". It will not be displayed on any page,
so it doesn't need a module.
Create your "real" menu (for example, "main menu") and the menu item that will display for all users (for example "Submit an
Article"). The menu item will have a menu item type of "Alias". It's
"Menu Item" parameter will be the "Submit an Article" menu item on
the "hidden menu". The Access Level for this menu item will be
"Public", since we want everyone to be able to see and use it.
Create a module of type "mod_mainmenu" for this menu, just like you
do for any menu.
Create a login module and set the access level to "Public". Make sure the module is displayed only on the "Public" menu item and
not the registred item, and select a visible position.
Now, when a guest (non-logged-in user) accesses the "Submit an
Article" menu choice, it redirects them to blank page with the "Only
for registred visitors" message. . If they log in successfully, they
are taken to the desired page (in this case, "Submit an Article").
If there were already logged in, they go there directly.
If what you want is just to show a content if the visitor is a registered user, you can use this code:
$user =& JFactory::getUser();
<?php
if( !$user->guest ){ ?>
[[what ever you want to do ]]
<?php endif; ?>
Hope that helps!!
Go menu CONTENT, create or edit a section to the items you want to protect.
You'll see an option: Access Level
There is 3 options:
Public, Registered and Special
Set it to:
Registered
Then you'll need to change your articles for this section and that's all.
First of all you have to update your joomla installation to 2.5 (it's the latest version of joomla), 1.7 is no more supported by Joomla community.
There are several ways to set your viewing rights. K2 is a useful CCK component to do the job, also a useful technique that I use to follow is to "link" your article's categories in a menu and set specific permissions to the menu items