How to reuse page css design to another - css

I'm new to Drupal8, and I have a default search page with CSS design. also, I have another page for search-api-solr page. I want to have the same CSS design on the default search page into the search-api-solr page.
Note: both pages have the same content, a search field with button and tags section and grid for the result.
How can I get that done?
Any advice?

Related

How to set HTML and CSS website on WordPress?

I have a Website that is designed on Html and Css. Now I want to make it same as on WordPress. Tell me the best possible options that help me to create same as its style. I also want to add that css on WordPress.
You have several options for that.
1- Create your custom theme. this will allow you to add your HTML and CSS codes.
2- you can use page builders like Elementor and use the HTML element. then by adding your HTML and CSS codes that will render on the page.
Using both above methods will not allow you to edit page as you normally do using page builders. it has to be using HTML and CSS.
3- Re-create your website using page builders on wordpress, it will be easy and fast and you can make future edits easier.
Navigate to your Admin Dashboard.
You can use the WordPress Visual Editor to quickly add HTML files to
your website.
Click Pages in the left sidebar. Next, look at the left-hand
sidebar.
Choose an existing page or create a new one.
Click Add Block.
Add a 'File' block.
Choose your HTML file.

Fixing Angular 4 layout

I am building a small application but this is my problem, I have a landing page with a search box in the middle, this page has a footer. All this page does is query something then navigate to a listing page. In the listing page I do not need the footer anymore, but later other screen may use it. My problem i have been having so far is that if my landing page with the search bar has a background image for the body, i have to do some monkey business in my listing page to remove it as well as the footer.
Is there a way I could have a page in Angular 4, say my index.html where this has a component (other than the <app-root>), this component will have all the head and html needed for that landing page but then when i navigate to the listing one , i want to have a different body and then here add the <app-root>
but then i am not sure how my routing will work.
It comes down to be able to apply css to my body from anywhere in the app without having to do monkey business from the child components to add classes or remove them.
Bear with me, i am new to Angular4 and i am paying the price.

Change the theme of one page without changing menu, search bar... in WordPress

Is there any way to use a theme only for the contents of one page?
I have already tried Multiple Themes plugin but it changes the appeareance of the whole html document (menu, search bar,... also)
Yes, you can.
1.Change the Content Structure.
To change the content structure, you need to create a custom page template.
You can follow this article to know more about how to add a custom page template to your theme and assign it to your page.
http://www.wpbeginner.com/wp-themes/how-to-create-a-custom-page-in-wordpress/
2.Only Change the Style
If the theme do it right, there should be a specific css class for the page on the HTML body tag. For example, page-id-1234. So all you need is add the css with the class for the page.
.page-id-1234 #entry-content {
//some css for the page
}

Classes on the body tag are same after redirecting to other pages

I am a new guy in the wordpress development town. I have mobius theme installed in wordpress. And implemented one child theme for that. I'm using style.css for styling all the pages. As i'm using one css for multiple pages I am checking the class on the body to ensure my styles will get applied on that page only. This is very important for me to have the required class with page id on the body tag. But all the classes are getting messed up after redirecting to any other page.
This is scenario happening with me.
Classes on the body present when visited home page for first time was:
'home page page-id-40 page-template-default'
After redirecting to other pages e.g. 'meet the team' page, I was expecting to have different classes. 'page page-id-1195 page-template-default'. But the classes on the body tags are unaffected.
But If I refresh the redirected page 'meet the team' I can see all the expected classes on the body tag.
Since your theme is using ajax to load page content, you must follow the way it works when trying to implement custom style and javascript.
Your theme must have some javascript functions which trigger ajax call to get a new page and then replace the current page content with it. Find those functions and add your custom js based on the loaded page in its ajax callback function.
I see it is using jQuery, so you can refer to the documentation:
http://api.jquery.com/jquery.ajax/
http://api.jquery.com/jquery.get/
Your style could be done the same way, but it's better to provide all custom styles during the first page load.

Single page in Joomla have a different site logo than other pages

I've not used joomla much before. I'm trying to just get one page of a site that uses a Joomla template to have a different logo than the rest of the site, or even hide it. I'm mostly a Wordpress developer, so just don't know how this can be done in Joomla.
Is there a way to assign a body class to one specific page in Joomla and have it hide the element?
If you edit a menu item, you want to look under "Advanced Options" and then "Page Display Options". There is a box for "Page Class" which adds a class to the page, so a body class as you wanted.
You can then tweak your template to show different pieces in CSS based on this class.
If you want to drastically alter the page, you can also assign different templates to different pages through the template manager. This takes a little more work (since you have to install and set up another template).
This would be the preferred way to handle a lot of changes so you don't have to have lots of competing CSS based on page classes.

Resources