-
Posts
534 -
Joined
-
Last visited
-
Days Won
11
Everything posted by Sergio
-
Found something different: my string-php.json file has two hyphens instead of 3 on the textdomain line, look: { "file": "site\\templates\\_strings.php", "textdomain": "site--templates--_strings-php", "translations": { "2f73c44cbb8a98616f8aeca67192aec6": { "text": "\/de\/" }, "77eb6543a21ba5c45f9c11f899136eee": { "text": "Kontakt" }, "68780987fca9c3f52fb511f87cd43262": { "text": "\/de\/kontakt\/" } } } I'm on Windows 10.
-
@rash I downloaded a fresh copy of PW master, installed the Multi language profile and replicated your settings. Everything worked! So, there's something you may have missed in your setup.
-
Pagination create different markup for active link
Sergio replied to hberg539's topic in General Support
Hi Kevin! Welcome to the forums. Add the "currentLinkMarkup" to your array, like this: $results = $baustelle->children("limit=2"); $pagination = $results->renderPager(array( 'nextItemLabel' => "Next", 'previousItemLabel' => "Prev", 'listMarkup' => "<ul class='pagination mg-b-0'>{out}</ul>", 'itemMarkup' => "<li class='page-item {class}'>{out}</li>", 'linkMarkup' => "<a class='page-link' href='{url}'>{out}</a>", 'currentLinkMarkup' => "{out}", 'currentItemClass' => "active" )); echo $pagination; -
Hi and welcome to the forum! Your approach is good and flexible, so that's a good start! To output the alerts on all pages in the front end, you have some options. I'll show 2 of them: 1 - Do the logic in the layout file that's shared by all pages In a default PW project, all pages can share a main layout file, usually _main.php. And on this file, you can output your Alerts pages' content, like so: //_main.php file <body> <?php $alerts = $pages->find('template=alerts'); // considering your template is called "alerts" foreach ($alerts as $a): ?> <div class="alert"> <h1><?= $a->title ?></h1> <h1><?= $a->body ?></h1> </div> <?php endforeach; ?> ... rest of file 2 - Using the render function to output the content of you ALERT template in all, so the logic (the foreach etc.) is done in that file, not in _main.php
-
HEEELP! This request was aborted because it appears to be forged!
Sergio replied to Pixrael's topic in General Support
Check these posts and this issue: https://github.com/processwire/processwire-issues/issues/28#issuecomment-252870084 -
HEEELP! This request was aborted because it appears to be forged!
Sergio replied to Pixrael's topic in General Support
What version of PW are you running? Did you upgrade it too or only the database? -
HEEELP! This request was aborted because it appears to be forged!
Sergio replied to Pixrael's topic in General Support
I'm assuming you have a backup of both files and database (when it ran on MySQL 5.1), right? Is it possible to try the procedure again on you local machine? Or if I can help you on that, send me the files and a dump and I'll try to run it here? -
HEEELP! This request was aborted because it appears to be forged!
Sergio replied to Pixrael's topic in General Support
These folders are created automatically if they don't exist, I think. Keep the files. Try again and tell us what happened. -
HEEELP! This request was aborted because it appears to be forged!
Sergio replied to Pixrael's topic in General Support
Dumb question, did you try to delete ALL folders (except files) inside /site/assets/ ? -
I'm assuming you're talking about user registration, right? If so, you can set the password yourself, using the API: http://cheatsheet.processwire.com/user/user-properties/user-pass/
-
I don't know.
-
I don't know if I understood it right, but what about using FieldtypeRuntimeMarkup to show the image based on the option field selection?
-
site-profile Yet Another Blog Profile: Editorial
Sergio replied to BitPoet's topic in Themes and Profiles
@BitPoet, you're on fire!! It will be useful to a lot of people, especially beginners. -
[solved] Do the PW commercial modules all support multilang?
Sergio replied to neosin's topic in Multi-Language Support
I can only speak by my experience with them, so: ProCache: 100% support ProDrafts : 100% support FormBuilder: almost all fields support, but Options and Select fields. But there's a workaround. ProFields: I think only Table won't accept multilanguage fields. The other profields work fine. ListerPro: I didn't use it yet, but I think it fully supports ML's as it is a extension of the basic lister. -
ProcessWire + RepeaterMatrix + CSS Grid Page Builder Concept
Sergio replied to Jonathan Lahijani's topic in Dev Talk
This is awesome, @Jonathan Lahijani!!! Great work!! For those eager to learn CSS Grid, I recommend this excellent (and free) course by Web Bos: https://cssgrid.io -
Came back to say that the regex example I gave can also work without regex, because we're not actually using its power. So, if you just add "map" and "carte", one per line, on the URL Segment field, in the template settings, it will also work. Regex is more appropriate when you have cases like these: //to get segments like /export-json or /export-xml regex:^export-(json|xml)$ //to get segments like "2018/episodes" regex:^\d{4}/episodes$ //to get segments like "category/ebooks/". I used this when there's no category pages associated with the template, just options of a Options field. regex:^category/[a-z]+$
-
No problem! Regex to the rescue! Take a look at other examples here: https://processwire.com/docs/admin/setup/templates/#which-url-segments-do-you-want-to-allow
-
URL segments that you enable on the template settings are just strings, not selectors, so ProcessWire won't be able to do this kind of check. But you can accomplish it by doing the following: On Template Settings, add a regex on the URL Segments field like: regex:^(map|carte)$ On your template code, add a check: // we are only using 1 URL segment, so send a 404 if there's more than 1 if($input->urlSegment2) throw new Wire404Exception(); if($input->urlSegment1) { //if there's any segment that matches the ones you specified on the Template Settings, PW will proceed. //do your code } Going to example.com/map or /carte will pass the conditional.
-
<div class="row"> <?php $i = 0; foreach ($page->umf_img as $image) { echo "<div class='one-fourth column refs'><img src='$image->url'></div>"; if ($i % 4 === 0) { echo '</div><div class="row">'; } $i++; }?> </div>
-
Hum, I think you have a similar problem I related here:
-
Why not add the new role to the user and then remove his/her other role?
-
You can access a repeater field directly by its name, no need to use $page->template.. So, to get a title field inside a repeater, you just need: $repeater = $page->your_repeater_name; foreach( $repeater as $rep ) { echo $rep->text_field_name; echo $rep->page_reference_field_name->title; //output the title of the page that's referenced }
-
Ryan, great work, as always, on the "owner" selection! Very cool stuff!! I'm eager to use it someday!
-
Generation of hreflang links for search engines as a module?
Sergio replied to chrizz's topic in Module/Plugin Development
Thanks! I've read that page and this one: https://www.rebelytics.com/hreflang-annotations/#step5 In the website I mentioned, I have the homepage as "/" and hreflang of "en". So I'll add a third hreflang tag with x-default value. The other language it "/pt". The user is not redirect upon arrival, he/she must select the language. <link rel='alternate' hreflang='x-default' href='http://example.com/' /> <link rel='alternate' hreflang='en' href='http://example.com/' /> <link rel='alternate' hreflang='pt' href='http://example.com/pt/' /> Actually, after reading it again, in this case I think I should have only to values: <link rel='alternate' hreflang='x-default' href='http://example.com/' /> <!-- default language is english for all users --> <link rel='alternate' hreflang='pt' href='http://example.com/pt/' />- 6 replies
-
- 1
-
-
- multilanguage
- seo
-
(and 1 more)
Tagged with:
-
Generation of hreflang links for search engines as a module?
Sergio replied to chrizz's topic in Module/Plugin Development
Hey @chrizz. I'll read more about x-default, thanks! About the lang_code field. It's a custom field that I add to all my multilanguage projects. This is useful because I set the homepage path to be "/" to the default language so in the hreflang value, I output the real lang code, like "en" or "en_US" for instance.- 6 replies
-
- multilanguage
- seo
-
(and 1 more)
Tagged with: