Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 457 Vote(s) - 3.51 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Drupal: Create a custom page

#1
I am working on developing a drupal site right now. I have created a custom homepage and it works fine with a module called (front page). However, I need to create a custom page for an internal page. Meaning, I need to have a different design than the general drupal theme I have right now but I am not sure how to do that (in an easy way that wouldn't take much time). I have the design in HTML and CSS ready but i just need to have something like (custom page) in the menu so when i click on it it takes me to that design (not external link though!)

I hope this was not confusing but if you have any questions I will be glad to answer them.

Thank you for your help in advance :)
Reply

#2
Unfortunately there's not really any way to do it "in an easy way that wouldn't take much time". If you want to theme your site you have to learn to theme. How long it takes you will depend on how much you want to deviate from the default theme templates. Here's a good place to start reading:

[To see links please register here]


Also, you may want to consider the Zen theme as a base theme. It will help you follow best practices.

[To see links please register here]

Reply

#3
## Html overiding ##
For a single page, you can create whatever html you like with drupal, using

* templates
* theming functions
* Write the exact html yourself, creating a theming function or just putting it in a template while.

Since you want a unique layout you want to look into a custom page.tpl.php. You can create a page.tpl.php for any url, which will allow you to modify the entire page html for that page, or just tweak it here and there.

Drupal has a quite flexible theming system, so there are many ways to change the markup. All of this stuff would need to go into your theme or a module.


## CSS overriding ##
You will still have the css files that are used in the drupal site.

* You can add additional stylesheets, with [drupal\_add\_css()](

[To see links please register here]

), but you might have problems with the other style sheets conflicting.
* You can remove all other stylesheets in template.php or remove them from your page.tpl.php, but then drupal\_add\_css wont work either.
* If you do this, you could generate the link to the css file yourself, in
* your markup
* template.php
* the page.tpl.php file.

## Static page ##
If your aim is to create one on only on page, with different layout ect, the quickest and easiest way, would be to create our own page.tpl.php file, and just write all your html in there and forget what Drupal can do. It's not generally a best practice, but in this case, doing stuff with the flexibility of Drupal might be a bit overkill, especially if you don't know Drupal well. You could possibly with the page template naming convention do this aproach, just adding a file with your markup in your theme. This approach would be good for a static site, but can also be done with a bit more effort for other pages. If you want to use a lot of modules, this wont be the solution for you. You should instead look at the theming functions / template.php and what can be done there.

## Change your Drupal backend / admin theme ##
If your aim is to create a backend theme, drupal has several modules for this, the most used these days is probably the [admin module](

[To see links please register here]

). Even if this is not your aim, this is a great module to make your backend a bit more user friendly.
Reply

#4
So the solution is have something like :

page-node-7.tpl.php

for page that has a path of (node/7) for example. And then it will load that page instead of the drupal page node/7

Thanks everyone :)
Reply

#5
You can use the [module Themekey](

[To see links please register here]

) which is a generic theme switching module.

If you want to switch the theme

- for different taxonomy terms
- based on the node type
- for different languages
- based on the path

then ThemeKey is probably worth a try.

Another solution is to use a preprocess function and change the 'theme' keyword in the variables.
Reply

#6
If you simply need a different template for ALL internal pages and one for the front page you can just use page.tpl.php (thats for internal/default pages) and page-front.tpl.php (for the front page).

Otherwise, there isn't a "quick and easy" way to do that. However, there are multiple ways. Read the theming guide as Aaron suggests and figure out what best meets your needs.
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through