Quantcast

Hide "Edit Page"

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Hide "Edit Page"

Priyanka_Mallu
Hi Pedro,

Is it possible to hide" Edit Page" for users and make it visible for admins only?
Users always keep asking about it.

Is it against Nabble policy?

And what about "powered by nabble" ?
Long time back I had read a post that its possible to hide "powered by nabble" ?


Thank you,
Regards,
Priyanka
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Hide "Edit Page"

Pedro <Nabble>
I can let you do it now. However we may change it in the future.
Please, create this macro:
<macro name="hidding_powered_and_naml">
     $("td.footer-left").css("display","none");
    <n.if.visitor.is_site_admin>
        <then>
                $(document).ready(function() {
                $("td.footer-right").css("display","none");
                });    
        </then>
    </n.if.visitor.is_site_admin>
</macro>
Then, edit your js_page macro:
<override_macro name="js_page" requires="servlet" unindent="true">
    <n.dont_cache/>    
    <n.javascript_response/>
    <n.call_later_handlers/>
    <n.hidding_powered_and_naml/>
</override_macro>
My test forum.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Hide "Edit Page"

Priyanka_Mallu
Pedro this code disables admin itself from seeing "edit page".

Visitors are able to see it both "powered by nabble" and "edit page".
I want only admin to see it.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Hide "Edit Page"

Pedro <Nabble>
Sorry, Please, try this code for that macro:
<macro name="hidding_powered_and_naml">
    $("td.footer-left").css("display","none");
    <n.if.not.visitor.is_site_admin>
        <then>
            $(document).ready(function() {
            $("td.footer-right").css("display","none");
            });     
        </then>
    </n.if.not.visitor.is_site_admin>
</macro>
My test forum.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Hide "Edit Page"

Priyanka_Mallu


Pedro I am getting this error.Could you please look into this?

Thank you.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Hide "Edit Page"

Pedro <Nabble>
I looked. Please, see your advanced editor.
I didn't find anything wrong.
My test forum.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Hide "Edit Page"

Priyanka_Mallu
Hi Pedro.Sorry I had deleted this code in the macro when it prevented me from seeing it.
<n.hidding_powered_and_naml/>

It is visible to me and not visitors.

What I noticed it both "powered by nabble" and "edit page"  is still visible in the login page.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Hide "Edit Page"

Pedro <Nabble>
Let's try another approach.
1- Delete your js_page override.
2 - Delete the hidding_powered_and_naml macro.
3 - Add this two overrides to your code:
<override_macro name="macro_viewer_page_link">
    <a style="display:none;" href="[n.macro_viewer_page_path/]" rel="nofollow">Edit this page</a>
    <n.visible_for_admins selector="td.footer-right a" />
</override_macro>
<override_macro name="nabble_homepage_link" dot_parameter="text" parameters="class">
    <a href="[n.nabble_homepage/]" class="[n.class/]" target="_top"><n.default. to="Nabble"><n.text/></n.default.></a>
    <script>  
        $(document).ready(function() {
        $("td.footer-left").css("display","none");
        });
    </script>
</override_macro>
My test forum.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Hide "Edit Page"

Priyanka_Mallu
Pedro this is perfect! Fits my requirements!

Thanks Pedro !
Loading...