By kendre_paresh on
hi all,
I have written my own module for creating web pages.As a admin i have an ability to disable the page.
the URL of the page is www.example.com/page/%
can some one tell me how to disable the url??? hoe can i flag an message saying 'page you are trying to reach is disabled by admin' like access denied or 404 error in Drupal.
thanks in advance...
i am using Drupal 6.20.
Comments
Hi! If you want to display a
Hi!
If you want to display a custom message then you should check if the page is enabled before you send back its content. If it is disabled then you send back your custom message.
Or you could write a custom access callback for the page/% menu item and check the availability of the pages in that function. If it is disabled then you return FALSE and the browser will show the Access denied.
How about creating a page
How about creating a page with your custom error message, then use the following:
Well then the check will run
Well then the check will run on every page. Like node/* forum/* etc. I think it is better to connect the redirect to the pages only.
Maybe you could put the redirection in the beginning of the page creation, like this:
But this is only my opinion. There are a lot of solutions to achieve this functionality.
Yep, I agree.
Yep, I agree.
hey :) thank you so much i
hey :)
thank you so much
i tried both option and found that both are working.
return false; in function works exactly similar to access denied.(i learn some thing new here :))
but i prefer drupal_go() since I have to display custom message.
thanks for putting your time and effort into it. :)