Skip Navigation

[Resolved] Access and empty tags

This thread is resolved. Here is a description of the problem and solution.

Problem:
When you add an Access ShortCode to a Post body, and display it, it will render an empty

<p></p>

tag

Solution:
There is an attribute "raw" wich can be "true | false" and depending on it, it produces a

or not.

So to not produce a

you would use:

[toolset_access role="Administrator" operator="allow" raw="true"]Test Allowed[/toolset_access]

The problem this is not in the GUI currently, but will be in the next Access version.

This support ticket is created 7 years, 9 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 5 replies, has 2 voices.

Last updated by Beda 7 years, 9 months ago.

Assisted by: Beda.

Author
Posts
#474671
nothing-in-loop.png
nothing in template.png
filter.png
content cell.png
annoying-space.png

Views or Layout is adding annoying space before the content.
I have not added any <p> tags in Views and Layout uses the new "Content" module. (Layouts Beta)

In front end either Views or Layout is adding

<p><br><p>

before the View content.

See images.
Attached images shows the Layout, the filter I've added to the view, the loop, and the content template and finally the result in front end.

#474934

I am not sure how you insert this View.
I do not see the cell in your Layout.

Might it be that you insert it below the "The Content" Cell, and have nothing in the Content?
I think the "The Content" cell is outputting this empty <p> tag.

But I need to see this one to one.

Can you send me the exported Layouts, Views and Content Templates?
I can then deploy them locally and see what is the issue.

Please mention wich exact Layout/Content Template and View is the affected one.

You can export the contents with the "Import/Export" feature under the Toolset menu.

Then you can share them with me via a Google Drive Folder

#475026

I added the view with a standard shortcode on a Page that uses this Layout.

Confirmed:
Yes, it is the new "The Content" cell in Beta version of Layouts that adds the space before the actual post-body content (that calls the View).

If I replace "The Content" cell with standard "Visual Editor" cell with [wpv-post-body view_template="None"] no extra space is added before post-body.

This is perfectly ok for a Beta-version but can you please forward this info so that it does not happen in the release?

#475198

Yes, but that is WordPress, not Layouts.

See, when you use a Visual Editor Cell you do not rely on WordPress rendering.
If you use "The Content" you will rely on the Content Editor of WordPress and that one ALWAYS wraps every line into a <p>.

Also, I can not replicate the <br> tag.
I inserted both a View and just some text to the WordPress content editor and it renders with a <p>, wich is expected, but not with a <br>.
This must come from somwhere else.

Can I gain login to the Site to see the exact setup?

I would need the exact links to all involved content.

#475372

I found the solution myself. It is related to this support ticket - handled by you.
https://toolset.com/forums/topic/toolset-access-adds-in-layouts/

I had a conditional (toolset-access shortcode) in post-body and it created surrounding <p>.

When the condition didn't apply it - instead of not rendering at all - it renders <p><br></p>

#475801
This ticket is now closed. If you're a Toolset client and need related help, please open a new support ticket.