I have a CMS in wordpress. I want a HTML snippet which we'll use it to show some content in other website.
Main CMS site is http://example.com, other site is http://other.example.com.
Now we want footer to be same, i.e. abc.com and other.abc.com should share the footer. So that If I change footer from CMS, I don't need to change that in main site. The main site will use iframe to show the footer.
What I did
I created a static file and put in the folder (I am serving CMS through apache-bitnami tomcat stack) so the footer URL became http://example.com/footer/footer.html.
Issue is it is not allowing me to access via iFrame because of X-FRAME-OPTION is set to SAMEORIGIN. I don't want this to be changed for all the website.
Is there any plugin which creates embedded-able HTML snippet? Is there other way?
Yes. The iFrame makes the user read from http://example.com/footer/footer.html, but due to security constraints he doesn't do that and nothing is displayed.
So you (aka the server) has to grab the code from http://example.com/footer/footer.html and send it to the user.
Basically you create have to (somehow) create a site http://other.example.com/footer/footer.php (or any other url) which is no static file but mirrors the content of http://example.com/footer/footer. Then you make an iFrame to http://other.example.com/footer/footer.php (the mirror) and the users loads from the mirror, the mirror loads from http://example.com/footer/footer and the footer is displayed.
This is my programmer solution, i don't know how much of a (non-) programmer you are and if you want to do this.
Related
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
I have update a page in my wordpress site using web admin back end, but what I see is that even if I update a page, it does not get updated online. Moreover, some of the content of the page which I see online /live are not actually texted in the area where we put the content.
On the right side navigator, in the page attribute area Parent has been set to No Parent, template --> Home Page.
Can you please let me know what could be the possible reason why the live content of the page is different from what I can see in the actual text area through web admin panel?
Also updating a page does not reflects on the page as well for that particular page.
First make sure you are editing the right page. Click in the frontend adminbar on edit instead of navigating in the backend through the pages list.
Secondly it can be any caching related issue. Check out if there are any plugins or settings for this.
Areas that are on the page but not editable via the content can be widgets or any kind of theme builder stuff. Check in the backend design->widgets.
The page hierarchy (parent: no parent) can be differ from the actually website navigation. Check out design->menus. It is possible to build other hierarchies in the menus.
I need to add a page to a wordpress site. However, for legal reasons, the page cannot be placed in/managed by wordpress as we are not allowed to make any changes to the page or it's content. How can I add this page to our site, but keep it outside wordpress management.
Odd request, but here's one idea:
Create a page template with no dynamic content from the post, load this content into it. The only way to edit the file would be through raw code. Anything entered into the post/page content area would not appear.
Anything I do inside our Wordpress CMS for some of our pages does not reflect on the actual website. It's like as if it's disconnected. The other pages are confirmed connected though.
Why is this and where should I look especially that it happens only to selected pages?
Btw, I probably should've indicated a sample of the problematic pages. Here's one: http://www.criminal-lawyers.com.au/courts/locations.
Look the template of effected pages.
Take that page on admin panel on the right side of that page you can see page attribute section ,Look on the template that set for that page. It may be a static template that do not accept the content.
Just change the template to default template.
Then view that page .If content are reflected then request the developer to do that in the selected template also.
(NOTICE:entire style of the page is lost.You need to reselect to previous template and save it after seeing the change )
I know wordpress store the page content inside the database. If I wanna to add content and some programming content into the page, how do I do it? Other than going to wordpress dashboard > page > all pages, is there any way to access the page file so that I can directly write the codes to it?
You can use you webhost's file manager, or your own FTP client to modify the files that wordpress is made of. Though I recommend against this; if you want to do work beyond just editing the appearance, you should design your site from scratch. If appearances are all, search for a tutorial on making wordpress themes, then apply your shiny new theme.
You'll use page.php or page-template.php file under wp-content/themes/yourthemeName/
That way you will change the file template....