Thank you so much for this module, I've been looking for weeks for something like this. I added it to my drupal 7.8 development site without a hitch except for the detail of the message displayed to non premium users. I was able to set it in my configuration, but it's not showing up on my node. I tried several different themes (garland, bartik, stark) to make sure it wasn't a problem on that end, and none of them showed the message.

The only thing I can think of that may be interfering on my end is my use of the display suite module. I've looked for a field marked as "premium content message" but didn't see it as an option. It could be I need to manually add this field to the teaser layout, but I'm not sure how to do that. Any suggestions?

Comments

anrikun’s picture

First could you try to disable some modules (like display suite) to see if the message shows up then?

MrsWho’s picture

Correct: when I disable display suite, the message shows up at the top of the restricted page. I thought the solution might be to add a code field to the teaser layout in display suite to get the message in there, but I don't see a token for the premium content message. Is there one? If not, is there any possibility of adding one? (I know php, if you could just give me a hint at where in the module might be the best place to look for this info).

anrikun’s picture

I don't know much about display suite :-(, but maybe my latest addition to dev is the solution:
http://drupalcode.org/project/nopremium.git/commit/0b5943c

Could you grab the master branch from GIT and try it?

Then make sure that on the Manage display page of your content type, the Premium message field is set as Visible in Teaser context.

MrsWho’s picture

Success! This little modification did the trick.

A few notes: I had to disable the display suite module to get the field to show up (simply adding the modification and then running cron didn't work). Fortunately, reenabling the display suite means I can keep the field, so I get to keep my custom layouts and have the message (phew!) I'm not sure why this behavior happened, and discovering the reason will take digging into both modules, I'm sure. I'll put it on my to do list for after this project is completed.

Also, for users working with display suite, adding the Premium message field to Teaser didn't work, I had to add it to the Full content layout instead.

Thanks for all the help, I (and my client) really appreciate it.

anrikun’s picture

Glad it works.
Can you confirm that you used the last dev from GIT to make it work?

MrsWho’s picture

I followed your link and added:

Added Implementation of hook_field_extra_fields() so that the nopremium message may be reordered or even hidden.
master
author Henri MEDOT
Mon, 18 Jul 2011 21:39:30 +0000 (23:39 +0200)
committer Henri MEDOT
Mon, 18 Jul 2011 21:39:30 +0000 (23:39 +0200)
commit 0b5943cf8492bfe8a2321c429dffc4528f803fed
tree 48ea177a89b3324e63c2f611a5ed30601db162be tree | snapshot
parent 87f39a6ce6c7cdb2529f7dad6c140e97dd3f945c commit | diff

anrikun’s picture

Ok thank you for your confirmation.
About:

Also, for users working with display suite, adding the Premium message field to Teaser didn't work, I had to add it to the Full content layout instead.

I know this new feature still needs some improvement, so in the meantime users should do like you said.

criscom’s picture

I also applied the above patch and the premium message appeared. So far so good.

The problem is that in Display Suite in the Teaser view only those fields are visible in the designated regions that have also been defined in the Default or Full content view. Thus Default or Full content view and Teaser view can only have the same structure and fields.

If I wanted to have another field in the footer region, I would have to position that field in the Default or Full content view first. Thus it is not possible to have a Teaser view that has different fields than the Default or Full content view. This is, however, what I need: I need to position a block field in the footer region of my Teaser view, which shouldn't be visible in the Default or Full content view.

Any suggestions how I could achieve that would be very welcome. Also prepared to contribute to the development of Node Option Premium module.

llribas’s picture

Issue summary: View changes

the last 7.x-dev version seems to work fine with display suite, and you can arrange the "Premium message" field in the position you like.

Anyway, if you don't want the "Premium message" field to display in the "teaser" mode (and set "inactive") but you want to display in the "complete content" mode, then the field doesn't appear in the "complete content" mode (or "default" mode).

I understand that this is because of the desing of the module (only shows the fields in the "teaser" if the user doesn't have permission to view premium node), but maybe the ideal would be that the "Premium message" field displays in the "complete content" display mode (or "default") regardless it's showing in the "teaser" or not.

For the moment I just hide the "premium message" in the teasers with CSS "display: none".

hiral.chandora’s picture

I am using last 7.x-dev version. I cannot see the message. However, I can see settings for "Premium message" under the "manage display" of article content type.

I am wondering as I have checked my installed module list and I cant find any module named as "Display Suite". In contrast, I thought, it may be because of "Entity View Mode" module which define custom view modes for entities, so I tried to disable it and still cant see any premium message. Any suggestions/help?