2

I have a rich text field that needs to have the cite tag within. See here:

redactor in Craft cms

It is currently ouputting as:

<blockquote>
    This is the quote.
</blockquote>

Whereas I need to work in an option for the client to create this:

<blockquote>
    This is the quote.
    <cite>
        John Doe, Founder
    </cite>
</blockquote>

What options are there for formatting some copy to be within the blockquote tag, but then formatting some of it to be wrapped in cite tags?

Thanks, Jay

1
  • We have discussed the options of having this as a matrix, but this rich text field is already within a matrix. And keeping all content-based markup like this within the rich text editor is better for the client, too.
    – Jay
    Jan 5 '17 at 15:27
4

You can use the Redactor Inline Styles add-on then use the following in your Redactor json config:

"plugins": ["source","fullscreen","inlinestyles"],
    "buttonsAddAfter": "italic",
    "buttonsAdd": {
        "cite": {
            "title": "Cite",
            "args": ["cite"]
        }
    }

You'll then be able to add a cite element within a blockquote formatted text.

1

Craft uses Redactor as its rich text editor - Redactor has numerous configuration options, one of which is direct html editing. One option would be to create a new Redactor configuration that includes the 'html' button.

For example, You could copy Craft's "Standard" Config:

{
"buttons": ["format","bold","italic","lists","link","file","horizontalrule"],
"plugins": ["source","fullscreen"]
}

Into a new file myCustomConfig.json at craft/config/redactor, then add the 'html' button:

{
"buttons": ["html","format","bold","italic","lists","link","file","horizontalrule"],
"plugins": ["source","fullscreen"]
}

And select your new config from the Settings page. This should allow you to manually edit the html to include <cite> tags inside of your <blockquotes>.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.