Hi Whitecom,
What kind of issue you are getting? When you use [restricted] shortcode around wrapper. You also have to add closing [/restricted] shortcode as well. Can you try adding a restricted shortcode in text composer and see what is going on. It is always better to add shortcode in text composer. Sometimes Visual composer adds html codes for [ and ] instead of opening and closing square bracket. do_shortcode(‘[restricted]’) will also need closing shortcode: do_shortcode(‘[/restricted]’); are adding that as well?
Thank you,
Hi, thanks for the reply. When I put the shortcodes in “plain text” in admin it works fine, but I have a lot of content (several pages for extranet) and am letting my customer edit the pages. So I have to make a “wrapper” around all the content, not a wrapper for each “text-box”. Maybe it is best to implement it directly into the template?
Hi,
You could do that if you’re comfortable with it. You would just need to make use of WordPress’s do_shortcode method (https://developer.ww.wp.xz.cn/reference/functions/do_shortcode/).
If you’re trying to do it in the visual composer, then you’d need to try and do what we mentioned in our previous reply, which is adding a text element at the beginning and end, and adding the correct shortcodes in each.
Hello! Thanks, I have manage to find the solution now – The shortcode (wrapper) worked when I added the shortcode in “basic editor” (Visual Composer). Thanks!
@josteinf: I’m having a similar problem.
I am using SiteOrigin’s Live Editor which makes use of the tinymce editor as a widget within layout rows. As long as you enter the [restrict] shortcode above all of the text with closing tag at the end…while in the Editor text mode…(this is important), everything works.
However, if, at any point you switch to the Live View mode to edit the page, the [restrict] shortcode gets removed from its original location into its own tinymce editor widget in a row that gets added to the bottom of the page. That breaks the restricted access. So, be aware that this may happen when you switch back and forth as well.
The only way around this that I have found so far is to hide the page while I am working on it in the Live Editor. When done, copy the restricted code from the errant location, then delete that row, switch back to text mode and paste the restrict code into the correct locations (beginning and end of all text code). Then unhide the page.
Because I want my users to be able to access both the public and private areas, I wanted 2 restricted access pages (2 different member sets) to be listed in my submenu under the login menu item. @etoilewebdesign, is there a way to do this without the above mentioned pain?
-
This reply was modified 8 years, 9 months ago by
esarbege.
Hi @esarbege, it actually worked in Visual Composer to switch between “basic editor” and the “design view/live view” after implementing the shortcode in “basic editor”. I am sorry that it didn´t work in SiteOrigin’s Live Editor.. Hope you find a solution!
-
This reply was modified 8 years, 9 months ago by
josteinf.
Hi @josteinf, That’s great! Glad your issue is fixed.