
ngrmm
Members-
Posts
474 -
Joined
-
Last visited
-
Days Won
3
Everything posted by ngrmm
-
@JerryDi you already tried this?
-
What is the output for this: echo gettype($championship->winner_name);
-
that's right ?
-
@da² yes, but user IDs have normally only two digits
-
How to display page while images are getting resized?
ngrmm replied to Jozsef's topic in General Support
I'm curious and would like to know how the Drupal way handles the problem of layout shifts if images and image dimensions are not available on load? -
Then maybe winner_name is a multipagefield and you try this: $playerChampionships = $pages->find("template=Championship_results, winner_home_club={$page->id}"); foreach($playerChampionships as $championship) { echo "<li><a href='$championship->url'> $championship->title - {$championship->winner_name->first->title}</a></li>"; }
-
as @da² mentioned you missed adding the "->title" $playerChampionships = $pages->find("template=Championship_results, winner_home_club={$page->id}"); foreach($playerChampionships as $championship) { echo "<li><a href='$championship->url'> $championship->title - {$championship->winner_name->title}</a></li>"; }
-
@JerryDi could you paste in here the latest version of your code.
-
@neophron you could to set your settings here Setup > Templates > your-template > Advanced > List of fields to display in the admin Page List And maybe you look into a css solution to hide it for non-superusers. But I don't know if that is possible
-
@neophron why is code bad? Do you get an error or any output?
-
@JerryDi you can access fields and variables of your page (in this case champrionship pages) echo "<a href='$championship->url'>$championship->title</a>; have a look here: https://processwire.com/api/ref/page/
-
try this $playerChampionships = $pages->find("template=championship_results, winner_name=$page->id"); // or $playerChampionships = $pages->find("template=championship_results, winner_name={$page->id}");
-
I guess, it's this typo winner_name=§page->id' Should be winner_name=$page->id' You could also try winner_name=$page'
-
Display additional field next to title on tree list.
ngrmm replied to lenoir's topic in General Support
@lenoir you could also use the builtin option in the backend here: setup > templates > your-template > advanced > List of fields to display in the admin Page List -
assuming your other template name is championship you could do this in your player.php template $playerChampionships = $pages->find('template=championship, winner_name=$page->id'); foreach($playerChampionships as $championship) { // … }
-
How to structure Blog Posts, Categories, and Tags
ngrmm replied to ryangorley's topic in Getting Started
@ryangorley there is also the option to separate tags and categories from your blog tree structure and use URL segments. This way you could create URLs like /blog/tag-A/ and /blog/category-A/ at the same time -
@Jhin AFAIK there is fixed number of status options (locked, unique, hidden, unpublished, …) which you can set or check. Therefore you could add a checkbox field to your template. Then you could set the status in the backend or via API.
-
Making unpublished changes to pages that require approval?
ngrmm replied to mpdude's topic in Getting Started
@mpdude try this hook – Create a role for user, who should not be able to publish pages – Put this in ready.php file in the site directory $wire->addHookBefore('Pages::save', function(HookEvent $event) { $page = $event->arguments(0); $userRole = wire('user')->role; $page->of(false); if($userRole == "your_user_role_which_can_not_publish_pages") { $page->status('unpublished'); } }); -
Making unpublished changes to pages that require approval?
ngrmm replied to mpdude's topic in Getting Started
@BitPoet I've not tried it yet, but would this be not possible with a hook on page save out of the box? -
I think what happens is this: When you try to view [localhost/myprocesswiretestsite]/informations-generales/ processwire does not find any associated template and gives you a 404-Error. And your 404-Error-Page has the basic-page.php template. This is how it supposed to be. This happens also if you type in [localhost/myprocesswiretestsite]/qwer1234/.
-
strange, It worked for me. I pasted this and it got stripped with the default settings. After adding video to the pastefilter whitelist it stays. Which tags get stripped for you? <video width="320" height="240" controls> <source src="movie.mp4" type="video/mp4"> <source src="movie.ogg" type="video/ogg"> Your browser does not support the video tag. </video>
-
@TomPich welcome! Happy for you escaping WordPress. If you create a page in the CMS it always needs a template. This template defines which fields it has, handles access etc. … This is the backend part. In order to display this page under the it's own path you will need a .php-Template file in the dir site/templates/your-template-name.php So for your need you could do this: – create a new template in processwire Setup > Templates > add new – add your fields to this template – create a page with this template somewhere in the page tree As long as you don't create a php-template file for it, you will be not able to display it under it's own path. But you still can use the content of this page in other php templates.
-
You have to look for it in the module settings, not in the field settings Pastefilter whitelist is the section. Paste in this: p, strong, em, hr, br, u, s, h1, h2, h3, h4, h5, h6, ul, ol, li, blockquote, cite, a[href|id], a[target=_blank], img[src|alt], img[class=align_left|align_right|align_center], table[border], thead, tbody, tfoot, tr[rowspan], td[colspan], th[colspan], colgroup, col, sup, sub, figure, figcaption, code, pre, b=strong, i=em, video I just added video at the end of the default tags. I guess that the purifier will ignore this tags.
-
@Smirftsch which version of TinyMCE are you using? I usually use CKEditor and there you can allow extra Content in the options of the field. I think with TinyMCE you can whitelist html tags in the module settings. This would effect pasted content.