Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

EZP-31595: Parametrized embedded Content's URL generation #81

Merged
merged 4 commits into from
Jul 9, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
{% set content_name=ez_content_name(content) %}

{% if location is defined %}
<h3><a href="{{ ez_path(location) }}">{{ content_name }}</a></h3>
{% if objectParameters.doNotGenerateEmbedUrl is defined and objectParameters.doNotGenerateEmbedUrl %}
{{ content.name }}
{% else %}
<h3><a href="{{ ez_path(content) }}">{{ content_name }}</a></h3>
{% if location is defined %}
<h3><a href="{{ ez_path(location) }}">{{ content_name }}</a></h3>
{% else %}
<h3><a href="{{ ez_path(content) }}">{{ content_name }}</a></h3>
{% endif %}
{% endif %}
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@
: ''
%}

{% if location is defined %}
<a href="{{ ez_path(location) }}"{% if class is defined %} class="{{ class }}"{% endif %}{{ data_attributes_str|raw }}>{{ content.name }}</a>
{% if objectParameters.doNotGenerateEmbedUrl is defined and objectParameters.doNotGenerateEmbedUrl %}
<span {% if class is defined %} class="{{ class }}"{% endif %}{{ data_attributes_str|raw }}>{{ content.name }}</span>
{% else %}
<a href="{{ ez_path(content) }}"{% if class is defined %} class="{{ class }}"{% endif %}{{ data_attributes_str|raw }}>{{ content.name }}</a>
{% if location is defined %}
<a href="{{ ez_path(location) }}"{% if class is defined %} class="{{ class }}"{% endif %}{{ data_attributes_str|raw }}>{{ content.name }}</a>
{% else %}
<a href="{{ ez_path(content) }}"{% if class is defined %} class="{{ class }}"{% endif %}{{ data_attributes_str|raw }}>{{ content.name }}</a>
{% endif %}
{% endif %}
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,15 @@ public function buildView(array $parameters)
$view->setLocation($location);
}

if ($view->isEmbed()) {
if (
$this->permissionResolver->canUser('content', 'view_embed', $content->contentInfo)
&& !$this->permissionResolver->canUser('content', 'read', $content->contentInfo)
) {
$parameters['params']['objectParameters'] = ['doNotGenerateEmbedUrl' => true];
}
}

$this->viewParametersInjector->injectViewParameters($view, $parameters);
$this->viewConfigurator->configure($view);

Expand Down