I have tried both production and dev both arrive at the same end.

If I try the following example it works:

/%/view_mode

However as soon as I try:

/name/%/view_mode

I will not work.

Am I missing something and in the documentation it would seem this should work without issue?

Drupal 8: 8.3.5

CommentFileSizeAuthor
#5 allow_wildcard_anywhere-2896576-5.patch1.47 KBasila96

Comments

glynster created an issue. See original summary.

RAWDESK’s picture

I've tried to get this to work with a simple path like "project/%" where the default node pages from my project content type are displayed, but they are not recognized by this module and thus the alternative view mode is not applied.

Hence, I even received a WSOD with :

PHP Fatal error:  Maximum function nesting level of '256' reached, aborting! in /var/www/meeus-bouwprojecten/vendor/symfony/http-foundation/FileBag.php on line 60

Fatal error: Maximum function nesting level of '256' reached, aborting! in /var/www/meeus-bouwprojecten/vendor/symfony/http-foundation/FileBag.php on line 60
PHP Fatal error:  Maximum function nesting level of '256' reached, aborting! in phar:///usr/local/bin/drush/includes/preflight.inc on line 763

Fatal error: Maximum function nesting level of '256' reached, aborting! in phar:///usr/local/bin/drush/includes/preflight.inc on line 763

after entering "%" as path.

I am using 8.x-3.1 version.
Switching to https://www.drupal.org/project/ds

paul dudink’s picture

Hi Rawdesk,

The module has been designed as described in the helptext:

Show a node as "teaser" when the entity url/alias has a suffix of "/summary".
- Path pattern: "/%/summary".
- Entity type: "Content".
- View mode: "Teaser".
- If you have a content page which regular entity url/alias is "/my/great/page" and "node/123".
- You can now visit "/my/great/page/summary" and "/node/123/summary" which will render that node in the given view mode.

I understand how the "/%/" suggests that it could be anywhere in the URL and you could do "/summary/%", however as far as I know the module hasn't been designed for that.
I think this would be a feature request then.

paul dudink’s picture

Category: Bug report » Feature request

Changed the category to "Feature request" instead since this is not a bug. It works as designed (although the helptext seems to suggest otherwise).

asila96’s picture

Status: Active » Needs review
StatusFileSize
new1.47 KB

I had a similar scenario; I needed URLs like this to work: /prefix1/prefix2/%

Here is a patch that accomplishes that.

Note, you will need to enter your pattern as /prefix1/prefix2% (skipping the slash before %); otherwise you will end up with double slashes in the URL. There is probably a way to prevent that from happening, but I haven't found it yet, and this solution works for me.