Is there a simple way to remove these options - I don't want users to be able to use search, I want them to use the defined hierarchy.
I guess it's something to do with permissions, but can't see how.
Many thanks for any help.
Search and Find actions
10 posts
• Page 1 of 1
You could use the ploneCustom.css to remove them. If you are running firefox you can go to http://www.userstyles.org/ and follow the links to download and install the extension. Then look into a copy of the source for any dataface page. Find the element you want to remove. Look for its ID then in css the code would be
#IDNAME { display: none !important; } Or you can look for its class. Then type: .classname { display: none !important; } Or if you have several things you do not want to display you type .classname, #idname, tagname, table, whatever, you, get idea { display: none !important; } The reason to try it in userstyles first is to see if it actually works. Rarely you will have to refresh the page, as most times it will make the change immediately when you save your style. When you are satisfied with the code you have working, go into ploneCustom.css and insert you code there. This file does not exist by default, so you will have to create it. Then somewhere near the beginning of plone.css you have the following line: @import url(customPlone.css); After saving, restart your browser. For instance to remove your search at the top it is: .search_form { display: none !important; } To remove the Find tab just add this: #table-tabs-find { display: none !important; } So to sum up, you can add the following code to the top of plone.css in the dataface installation directory: @import url(customPlone.css); Then create customPlone.css and add these lines to it (along with any comments you wish to document why): .search_form { display: none !important; } #table-tabs-find { display: none !important; } That is all you have to do. Hope that helps bro.
Ok a couple explanations here. When I say the dataface source, I meant the GENERATED HTML PAGE...so in your browser on any page, click VIEW SOURCE...
The reason I do it this way, rather than looking at the generatING code..is because I can see my actual data. Then I can do a search on that data right in the view source window...and jump to it. I dont have to guess by looking at the dataface PHP..is this where my company name will go? is this where the list will go? Instead I am right there instantly. Second the code in ploneCustom.css could be shortened to this: .search_form, #table-tabs-find { display: none !important; } That will get rid of your find and your search.
Thanks to Aoirthoir for the stylesheet solution.
There is another way, however, that is undocumented (I apologize for that). To hide the search field in the upper right add the following to the beginning of your conf.ini file:
To disable the find tab, you would use permissions. The name of the permission is "find". Hope this helps a little. I can elaborate if you want some more details on strategies. Best regards Steve
Thanks for that info Mr. Steve.
As I delve into what you have done here with Dataface, I am more and more amazed. So many ways to change things. We've got that list I posted a while ago, and are going to consolidate it this week then shoot all those ideas over to the tracker for you and also make some more requests for on the clock type things. Ive been moved out of shipping now and am only going to be programming. So we want to speed our projects up a bit.
Hi Neil,
There are a few ways to go about this. The cleanest way is to create a new role. You can do this by creating a permissions.ini file in your application folder. Roles are designated by sections of the permissions.ini file. For example, let's make a new role that is the same as ADMIN but doesn't have access to the find tab:
You can set a user as having these permissions using the getRolePermissions() method of the Dataface_PermissionsTool class as follows:
Alternatively, if you can modify the permissions programatically by changing the array that is returned by getRolePermissions() etc.. e.g.
Hope this helps a little. -Steve
10 posts
• Page 1 of 1
Who is onlineUsers browsing this forum: No registered users and 18 guests |