• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

getting attached rule to stay in targeted rule menu

New Here ,
Jan 09, 2018 Jan 09, 2018

Copy link to clipboard

Copied

Hi, I'm using Dreamweaver CS5. I have hundreds of pages to apply a basic CSS rule to, but I have to reattach it on every page instead of it showing up again in the "targeted rule" submenu on the properties tab. Advice? Thanks

Views

593

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jan 11, 2018 Jan 11, 2018

well that is true that you can nest templates...

but if the structure doesn't change, and if it is just to make the groups display differently... you can use param templates for thta purpose...

it's easy to implement and use...

  1. first declare a param templates with a default value right on the HEAD (you can do a search and replace for that on the 500 pages)
    <!-- TemplateParam name="group" type="text" value="" -->
  2. then search replace the body tag... as
    <body class="@@(group)@@">
  3. select a bunch of files
...

Votes

Translate

Translate
LEGEND ,
Jan 09, 2018 Jan 09, 2018

Copy link to clipboard

Copied

What are you trying to attach the css rule too, can you show the bit of code?

Do you have a linked css stylesheet, common to every page, where you could insert this rule rather than physically attaching a css style to a piece of code?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 09, 2018 Jan 09, 2018

Copy link to clipboard

Copied

My use of DW is very basic so I'm not sure what the difference is between linking a css stylesheet and inserting a rule...I'm just trying to make one or two words on each page a certain code of red and using css instead of just changing the type color, so I can change the color globally later if I need to.

I don't have a css stylesheet common to every page - is that something I can set up to already existing pages?

thanks in advance

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 09, 2018 Jan 09, 2018

Copy link to clipboard

Copied

jeanl67660933  wrote

My use of DW is very basic so I'm not sure what the difference is between linking a css stylesheet and inserting a rule...I'm just trying to make one or two words on each page a certain code of red and using css instead of just changing the type color, so I can change the color globally later if I need to.

Sounds to me the only way youre going to be able to do that is using Search and Replace given the number of pages you mention.

You're probably trying to do something like 'This is some <span class="red-text">Red Text</span> in a paragraph'

If the words or phrase you're trying to make a specific color are unique in the page its possible through Search and Replace otherwise i have not a clue how you would do that.

Its not like you want to change a specific heading in a specific container to a different color which pulls the color from a global css stylesheet.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 09, 2018 Jan 09, 2018

Copy link to clipboard

Copied

Can I apply a stylesheet to many pages at once? So I can see it in the "targeted rule" dropdown menu on the properties tab, without having to add it individually to every page when it's open.

Thanks for the advice

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 09, 2018 Jan 09, 2018

Copy link to clipboard

Copied

jeanl67660933  wrote

Can I apply a stylesheet to many pages at once? So I can see it in the "targeted rule" dropdown menu on the properties tab, without having to add it individually to every page when it's open.

Thanks for the advice

Depends what you mean by apply a stylesheet?

You can 'link' a stylesheet to each page but just linking a stylesheet isnt going to help you as you need to apply a style within that stylesheet to something on your page.

You're looking to change the structure of your html IF you want to update specific words within a number of pages with a different color and unfortunately unless they are within include files there is really no automated process other than using find and replace,

So you might have:

'<p>The fox jumped over the lazy dog</p>' on a number of pages where you want to color the word 'jumped' in red or green or orange.

You would find the phrase 'The fox jumped over the lazy dog'

and replace it with:

The fox <span style="color: red;">jumped</span> over the lazy dog

Inline css styling (example above) is not advisable but since you have no global stylesheet attached to each page its the only way you can do what you need to do. Even if you did have a global stylesheet you still need to target the words you need to color change which you cant do if they are part of a sentence.

If you had a global stylesheet attached to each page and the words you wanted to change were within a unique html tag like <h2></h2> or <h3></h3> tag you would be able to change the color very easily.

If you do attempt to use 'find and replace' then make sure you back up your site folder as I personally would not want to use 'find and replace' on 100+ pages

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 09, 2018 Jan 09, 2018

Copy link to clipboard

Copied

jeanl67660933  wrote

Can I apply a stylesheet to many pages at once?

If your site is template driven, yes. 

From your Files Panel, expand the Templates folder and open the Template.dwt file.    See screenshots.

Place your mouse cursor inside the <head> tag.  Insert a link to your external CSS file from the Tools menu.  See screenshot.

Save Template and populate changes to all child pages.

Nancy O'Shea— Product User, Community Expert & Moderator
Alt-Web Design & Publishing ~ Web : Print : Graphics : Media

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 11, 2018 Jan 11, 2018

Copy link to clipboard

Copied

The 450+ pages are attached to a template but within those pages I need to apply the css type color change to groups. I couldn't figure out how to make nested templates for the groups so that's why I'm doing each page individually. I just wish I could skip the extra few clicks it takes to get the stylesheet attached (even keyboard shortcuts would help but I don't see any for attaching stylesheets). Sorry such an amateur!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 11, 2018 Jan 11, 2018

Copy link to clipboard

Copied

well that is true that you can nest templates...

but if the structure doesn't change, and if it is just to make the groups display differently... you can use param templates for thta purpose...

it's easy to implement and use...

  1. first declare a param templates with a default value right on the HEAD (you can do a search and replace for that on the 500 pages)
    <!-- TemplateParam name="group" type="text" value="" -->
  2. then search replace the body tag... as
    <body class="@@(group)@@">
  3. select a bunch of files the ones that belong to the same group and change the param value to something different as...
    <!-- TemplateParam name="group" type="text" value="groupone" -->
  4. repeat for every groups, keep the same rootname
  5. declare different rules in style sheet
    body[class^=group]{  // affect all groups } .groupone { } .grouptwo { } 

that's it... don't hesitate if that is not enought clear...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 11, 2018 Jan 11, 2018

Copy link to clipboard

Copied

Nested Templates are a terrible idea. 

If I understand this correctly, you want to change text color somewhere and have it populate to 450+ pages.    That's what a global CSS file is for.   Please tell us which HTML classes or IDs you have to work with?  If none are specified, you'll need to create one, for example, .red.

CSS:

.red {

     color: red;

     font weight: bold

}

HTML:

<p class="red">This text is bold and colored red</p>

<p>This text is normal</p>

Nancy

Nancy O'Shea— Product User, Community Expert & Moderator
Alt-Web Design & Publishing ~ Web : Print : Graphics : Media

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 16, 2018 Jan 16, 2018

Copy link to clipboard

Copied

Yes I wanted it to populate to 450+ files but not the same word in each page (more like 8 groups of pages among the 450).

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 16, 2018 Jan 16, 2018

Copy link to clipboard

Copied

LATEST

did you try the solution that I have proposed ?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 16, 2018 Jan 16, 2018

Copy link to clipboard

Copied

I cleaned up the organization of my remote files, and placed the .css file inside my website folder. For some reason now, I don't have to reattach the stylesheet for every page now. Thanks for all the help.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines