• Hi Aldo,

    More tinkering from me, sorry. Can the alt= specification be made, if it doesn’t already and I am just not doing it correctly, to accept HTML markup specifically to change the alt text color?

    I’m trying to find a way to subtly signal to my users, who are restricted from content and instead see the alt text, that they are reading alternative text to what’s really posted (to encourage joining a user group that will allow the true content to be viewed). And possibly “color code” the alt text to signal what user group has required permissions.

    And, as usual, thank you for a plugin that I lean on very heavily and confidently for my needs!

    • This topic was modified 3 years, 11 months ago by songiuno.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Aldo Latino

    (@aldolat)

    Hello @songiuno,
    you can change the appearance of the alt text using a CSS style. The alt text has this HTML markup:

    <p class="private alt-text">Hello there, you cannot read this private text!</p>

    As you can see, you can use the private and alt-text classes to change the look & feel of the p tag. Via CSS you can change every aspect (background, text color, font, etc.).

    For example, on my test site I have these classes:

    .private {
    	background: #89bf52; /* Green */
    	padding: 1.2em;
    }
    
    .alt-text {
        background: #fbe5a2; /* Light Yellow */
    }

    When the paragraph has the private class only, it has a green background color, but when it has the additional alt-text class, the background color changes into light yellow.

    With your browser inspector take a look at the source of the page: you will see that every paragraph generated by this plugin has some classes, that change according to the scope of the paragraph.

    Let me know, please.

    Thread Starter songiuno

    (@songiuno)

    Oh okay thanks, I’ll have to study up on css files to determine how to do this. So would this be in the theme’s style.css? I don’t see an existing on used in the private content plugin folder(s) itself.

    Plugin Author Aldo Latino

    (@aldolat)

    Yes, you have to edit the CSS file (usually named style.css) of your current theme.

    In addition to what I wrote, consider that, when you create a shortcode for a group of users, for example the marketing group, the class of the paragraph will have also the name of the group. If the groups are two or more, the class will have the names of all the groups. Here a few examples:

    Marketing Group

    <p class="private marketing-content">Hidden text for Marketing role.</p>

    Security Group

    <p class="private security-content">Hidden text for Security role.</p>

    Marketing and Security Groups

    <p class="private marketing-security-content">Hidden text for Marketing and Security roles.</p>

    In this way you can give a different style for each group or a combination of groups.

    Thread Starter songiuno

    (@songiuno)

    I’m experimenting now but think i got it. Thank you Aldo, as usual!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘HTMl markup (for text color) in alt= specification’ is closed to new replies.