I inherited a implementation of Gallery2 embedded in a Drupal site. I need to change the url of the page this is on from /gallery to /somethingelse.
Drupal is not something I am very familiar with, but I've done some stuff here and there with it years ago.
The /gallery page is not listed anywhere in the admin interface and the content is living in page-gallery.tpl.php.
A 301 redirect is going to be necessary (which I do know how to do), but that isn't the solution I'm looking for obviously (just to avoid getting that answer). Is there any simple way to change this url?
First you will have to understand how drupal handle URLs & generate a page based on it. There are several way to have a URL in drupal, where you can navigate from somewhere.
Usually we make page(add content) of some content type, which you create before with all the required fields. Drupal give serial node number to all newly created page, so to have your own custom URL, you will need to use PATHAUTO module, which will create URL based on title of the page, though you can modify at time of creating page.
We create listings of some things e.g. images for gallery by help of VIEWS & we can create page for the listing. We get to give URL for the page, which you can edit any time.
We declare URLs in our custom module under hook_menu(). Other contributed module also do the same & that's why you get some pages when you enable the module.
Apart from page content, drupal have block system. A block can contains content, image, links etc & display of it can be set to all pages as well as any specific page. So there is no limitation for you to make your page with the URL which you want if you are using PATHAUTO module. If you have listing from views or code which is generating page, then you can always go there & change.
Related
I have a site that was made in WordPress and I need to remake it just with HTML and php.
The problem is
I have a page at the url www.mydomain.com/create
I created a new file with same name, www.mydomain.com/create.php
Now on the host I removed the extension .php, but the problem is i will still hit the word press page.
Where can I find the file with the url set for this page? I don't know much about word press besides where plugins are.
WordPress does not use one file per page / post. WordPress instead has a template system inside themes that defines how pages and lists of posts are turned into HTML. The content of those pages and posts resides within the database and can be viewed in wp-admin. Further, WordPress extensions and themes can define hook functions and filters to modify content and style of the page and execute code upon certain events.
You cannot find a file for this "/create/" page. It has some content in the database but the content itself won't render into what you see in the browser.
Sorry to say this, but if you like to recreate the site, you will have to find a new way of constructing and rendering it (and also reusing code). You might also want to look for a proper framework like Laravel and have some proper routing in place (instead of renaming PHP files).
Edit:
You can change the permalink for create like so:
UPDATE PREFIX_posts SET post_name = 'create_old' WHERE post_name = 'create';
You have to adapt the MySQL table name to the WP posts table by replacing PREFIX with whatever prefix your WP posts table has.
I'm a WordPress developer who's been tasked to create a temporary one-pager to a Drupal site. The client would like to have a simple front page with a logo and 4 external links until their new site is ready. Normally I'd just make a simple index.html page with some CSS and call it a day. But in this case they need some of the sub-pages from the Drupal site to continue to work.
Had it been a WordPress site, I would have just created a new template file and a new page inside WordPress, and made that the front page. But as I have zero experience with Drupal, I don't know if you can do the same thing here.
What is the easiest (quickest) way to make a simple splash-page as the front page, while having the rest of the drupal site continue to work? The splash-page should ignore all CSS and JS from the original theme — preferably have a completely independant section fromt the rest of the site.
In Drupal 7 you have few "levels" of templates. First you have "most outer" template html.tpl.php It contains html head and it is usually common for all pages.
Then inside that html.tpl.php you'll include page.tpl.php. That one should again contain some common page elements, as header and footer, but again, if your design requires that, you can have more than one page template.
Page template will include node template. In drupal you have 2 basic content (node) types but you can create many more of them. Basically for every different page layout you can create new content type (but there also are lot of different ways to achieve the same thing).
Basically you should create new content type called i.e. "splash" (machine name!). Add fields to it if they need to be back-end editable.
Then you should create new template file for your content type. Name matters, so you should call it node--splash.tpl.php . You can find and copy to your theme existing node.tpl.php and change it to your needs.
Keep in mind that when ever you add/remove new template file you have to clear the cache so drupal would scan theme directory, notice and start using new templates.
And if you need also different page template for you page you'll have to put some code into you tamplate.php file:
https://www.digett.com/insights/overriding-page-templates-content-type-drupal-7
Drupal template engine design an specific file name for override front page.
You can create the file html--front.tpl.php, and this will be used only for the front page without touch any other page. You can page here your custom HTML and reference css/js.
If the page you need share common styles with the rest of the site, I would recommend to instead override page--front.tpl.php which is basically the content of the page without the tags
For more information here is a link https://www.drupal.org/docs/7/theming/howto/customize-the-front-page-template
So, I'm relatively new to Drupal, and I'd like to make a Drupal site with a front page with a grid of links to other commonly used pages on the site. This site is intended as a sort of community page for a small town, so it would be links like Government, News, Business Directory, History, Forum, etc.
Some of these pages are basic pages on my Drupal site, some are external links, and some are links to views or modules, like the aggregator module. I'd like all of the links to be sortable and generally have the same markup. I'd also like these links to be gathered automatically, i.e. via the 'Promote to Front Page' option or something like that. I ABSOLUTELY DO NOT want to hardcode this to a basic page.
So far my solution has been to create a view with a list of title fields from pages promoted to the front page, and a special content type I named 'Link' which are actually just redirects to external urls. The problem now is that I don't know how to include special pages, like aggregator or view.
Any ideas? Is there a better way to do this? Have I missed something?
The easiest way to do this is as follows.
Create a content type called link with a link field on it.
Create a page view that displays all content of type link and displays the field link
This is a very basic way of doing it, if you wanted more than one list on the page then that would depend on the theme you are using and the links would need to be categorized in someway using taxonomy.
You may also want to look at the flag module.
I have successfully created content types for certain pages which I have in Drupal. I have also successfully created menus for those content types, so when a user is on a certain type, for instance, Blog Article, they are presented with a certain menu. The problem is when I few all the blog articles the menu is there, but when when I few the /blog page which shows all the blog entries, the content block is gone.
I've set it up so the block will only be shown with certain content types, but there doesn't seem to be a content type of blog module in general. Is there a way around this? It is the same for the forum page. It will show for forum topics, but not for the actual forum.
I hope I've made my self clear, as it is quite hard to explain.
I do not know what version of Drupal you are using but I will try to help.
As per docs on drupal.org:
Configuring a block
Go to the Blocks overview page (Administration > Site Building > Blocks) to configure the blocks on your site. This page allows you to
drag-and-drop blocks into different regions as well as reorder the
blocks within a region.
Next to each block you can click "Configure" to change the specific block settings: Block title: Allows you to override the default title
for the block User, Role, and Page specific visibility: Adjust
visibility for block based on user, role or page. Additional settings
may also be available, depending on the particular block.
Note that blocks are configured per theme. If you change the theme or
enable multiple themes, you will need to configure blocks per theme.
Yeah. I may of messed the formatting a bit but basically, in step 2, you want to configure your block visibility by page specific visibility. It looks something like below:
Basically, I think in your case you could use that to show the blocks containing your menus on specific pages and add whatever paths you want your menu to show on.
Hope that helps! Happy coding
I figured it out. Instead of trying to display a block based on the content type you have to change it so it is displayed based on the URL. The reason for this is because the blog module which comes with Drupal 7 doesn't have a content type, so when a user arrives at http://www.example.com/blog there is no content type and throws all the blocks restricted by content type out the window.
To get around it I had to install a plugin called Pathauto. This plugin allows you to specify a default URL for a content type. Be sure to install this plugin first before creating any content as any previous URLs will not work, so you will have to manually go back and change the URL alias.
Once you have installed the Pathauto plugin go and setup your paths for content types. I set it up so anything which is a derivative of the content type "Blog Entry" is given the URL /blog/post-name
Now all you have to do to set the block is go to the block and click configure. In the section Pages make sure you select "Only the listed pages". You'll have to type two lines. blog and blog/*
Now that you have set this any new content which is created as Blog Entry will fall under this URL expression and the block will be shown.
Works like a dream now. What a headache to get working.
I have a wordpress site that i've been working on that has some pages (as in NOT posts) that a client changes content on in order to target particular keywords. these pages have been using podscms for content management.
The client now wants to be able to duplicate these pages any number of times and edit the text within them. So basically, he wants to be have a dozen or so versions of about 4 linked pages.
Does anyone know if it's possible to duplicate an entire multipage structure like this in WP?
Or any WP driven sites that implement segmentation similarly?
I think your best bet would be to use Page Templates. You define them in the theme and then for each Wordpress page you create, you can select which page template you would like to use for the page. This sounds like what you're trying to accomplish.