It seems that HTML is not allowed in the custom message for non-privileged users. Is it possible to ad HTML so the message can be styled? (Bold, italics, etc.)

Using Drupal 7.

Comments

anrikun’s picture

It is allowed but filtered using the default filter.
On 7.x, "plain text" is by default the default filter.
2 solutions:
- define a custom default filter.
- or override nopremium theme functions in your theme

axel pressbutton’s picture

StatusFileSize
new3.71 KB

Hi anrikun,

I'm trying to achieve the same here but my custom default filter is being ignored. It should at least be letting me add the following without spitting it out as text (see attached example);

<a href="/blah">text</a>

Plain text is 4th in my list of input formats. Have also tried this with Full HTML at the top of the list.

...any advice would be greatly appreciated. Thanks.

anrikun’s picture

I'll have a look at this once I get back from holidays :-)

megachriz’s picture

Status: Active » Needs review
StatusFileSize
new3.32 KB

I have created a patch that adds support for text formats for the messages, so you are able to use any filter.

The patch makes the following changes to the module:
- nopremium_settings_form() no longer calls system_settings_form(). Instead a submit handler is added to save the settings. I changed it this way because for the default message and for each node type two settings now must be saved: the message and the text format.
- A function nopremium_get_text_format() is added to get the text format for the given node type. Just as nopremium_get_message() it checks if the message is not empty. If the message is empty the text format used for the default message is returned.
- The function theme_nopremium_message() is altered to use the appropiate text format.

megachriz’s picture

StatusFileSize
new3.39 KB

Small change in comparison with the patch above:
- Adds message that the settings have been saved when the settings form is submitted.

seanbfuller’s picture

Added #5 and it is working great. A must have since most admins will probably want to include a call-to-action link to get users to a page where they can join to access the premium content.

liliplanet’s picture

StatusFileSize
new15.24 KB

please ignore the zip, don't know how to delete the attachment

deadbox’s picture

Please can somebody explain to a newbie how to apply the patch? Never mind I figured it out, all done :D

I'm finding it doesn't accept full html though. Although the full html option is there and my ckeditor shows the full set of buttons, I can't colour the font, change its size or add a border. It does allow me to make the type strong and include live links which is fantastic, but I was wondering if there's any reason why I can't customise it fully?

theSEOeffect’s picture

I am having this same issue and have never applied a patch before. Do I just navigate to the module and paste the patch somewhere? I am using the most recent version of the module and it would be awesome if you could give me a little guidance on how to implement this patch.

Thank you so much!

theSEOeffect’s picture

If I just uninstall the current version and install the #7 zip file listed here, does that include this patch? It seems like it would be so awesome just to say replace "this file" with "new file". Is that possible :)

Sorry for being such a noob...

megachriz’s picture

@theSEOeffect
https://drupal.org/patch/apply
The patch should be applied relative to the module folder. So, if using the command line, you would first need to go the module folder like this:
cd sites/all/modules/contrib/nopremium
There is no need to uninstall the module.

bjlewis2’s picture

Version: 7.x-1.1 » 7.x-1.x-dev
Issue summary: View changes
Status: Needs review » Reviewed & tested by the community
StatusFileSize
new139.26 KB

Patch in #5 works perfect against latest git clone of 1.x. Exactly what I was looking for!

devkinetic’s picture

kenorb’s picture

Tested the patch at #5 and it works fine, thanks.