Hide an element on a certain page using css or php?


(steve bee) #1

I have a series of pages that are dynamically created using php. I want a certain element to appear on most, but not two. Is there a way to do this via css or php?

Ta.

Tagging @teefers as I know he’s a right whizz with php :wink:


(Doug Bennett) #2

I would think so, would need more details on what is generating the pages and what determines what gets hidden when.


(Greg Schneck) #3

Be sure to click the blue Visit Demo page (jsfiddle) - Toggle button in bottom left panel.
https://css-tricks.com/places-its-tempting-to-use-display-none-but-dont/


(steve bee) #4

Thanks chaps, going to get some examples published and get back to you.


(steve bee) #5

Okey dokey.

This is the page: https://www.caffeineinjection.com/portfolio/ It uses @instacks Poster for the categorization and display of the portfolio items.

The element I want to manage is the “Back to main page” link below the images.

I want it displayed on all the pages generate by Poster except the following…

https://www.caffeineinjection.com/portfolio/

and

https://www.caffeineinjection.com/portfolio/?category=all#poster-top

So, essentially I want it displayed on all pages that contain poster content that is “filtered”, but not on the main pages. If that makes sense!

Example pages I want it displayed on…

https://www.caffeineinjection.com/portfolio/?category=newsletters#poster-top or any other page that filters a category. And…

https://www.caffeineinjection.com/portfolio/?post=newsletter-charge-bikes&category=newsletters#poster-top and all other “detail” pages.

Ta.


(Jannis from inStacks Software) #6

The show/hide stack does that already for detail/non detail pages. I might extend the show/hide Stack to show content also on filtered/non filtered pages.


(steve bee) #7

YES!

I promise, after that, I’ll leave you along for a while.

Well, a day or two at least :wink:


(Matthew Hirte) #8

Hi
I would like to learn a programing language to be able to take my websites to a higher level of control. Is there any particular one that is more compatible with RW? When viewing the “elements” of a page in a browser I notice that all the code lines start with (div) where as JavaScript uses (var) (Variable). PHP
seems to be the main language people are using. Is CSS a programing language?


(scott williams) #9

You can usually hide an element by targeting it with CSS
RW uses HTML/CSS some stacks use PHP & JS.

CSS is used for styling it stands for cascading style sheets.


(Matthew Hirte) #10

Hi Scott. Much thanks !
In RapidWeaver > inspector > html - there are two tabs. One for CSS and one for JavsScript. I’m assuming that you can use either one. Is it a good idea to know both or does CSS pretty much meet all the needs ?


(scott williams) #11

Apples and oranges.
CSS is what you use to “style” elements on the page.
JS is a scripting “language” used extensively for web applications
HTML is what is used (along with CSS) to build web pages

I would suggest that you Google a little to gain some perspective on each.

Most of the time using RW, you won’t need to do much with JS or HTML on your own as the basic functionality is already in place in the themes or available via already written stacks.

CSS is helpful though to “tweak” the styling to get what you want.


(Joe Workman) #12

Why not use my Agent stacks for this? Its exactly what they are made to do…

https://joeworkman.net/rapidweaver/stacks/agent


(Matthew Hirte) #13

Hey Scott. Much thanks !


(Matthew Hirte) #14

Hi Joe. Thanks ! I own agent. But have left it alone because I’m not sure what to do with it. Is there a tutorial to get started using it.


(Doug Bennett) #15

On the URL Joe gave you hit the middle icon to launch video:
2017-08-08_11-59-30


(Matthew Hirte) #16

Hi Doug. Much thanks !


(Matthew Hirte) #17

Hi Doug. I looked at the video and he explains a bit about it but I’m not far along enough in using RW to fully understand how all the applications work together. I understand the benifits for agent but not the operation. Do I use it separately instead of Foundation ?


(scott williams) #18

Hi Matthew,
If you can give some details (and better a url) we can better help you with the best way to do what you want.


(Robert Ziebol 🖖🏼) #19

Try this video
https://www.youtube.com/watch?v=zclGdCoQhQ4&list=PLAwL8Kl4ijMqdhhOGYDLjw5yxq58ytiGm


(Matthew Hirte) #20

Hi Scott. I’m not sure what you mean by “better a url”.

I’m in Foundation, trying to get text to wrap around a Photo. I’m using the “Clearing Gallery Stack” in a the "Floaty Stack”. The thumbnail photo is very small. How do I get the thumbnail photo to enlarge. In the Foundation tutorial (Ben Counsell). In the video his photos are much larger. How do I get that. Also in the box “Click here to add content”, I can add text but it doesn’t give me an option for text color.
I’m like Steve Martin in “Dead Men Don’t Wear Plaid” only instead of “CLEANING WOMAN !!, it’s “CLEARING GALLERY” !!