Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/15/2022 in all areas

  1. v1.15.2 exposes all variables defined in /site/templates/_init.php to all your rendered template files (latte/twig...) thx to @wbmnfktr https://github.com/baumrock/RockFrontend#using-the-sitetemplates_initphp-file
    2 points
  2. @MarkE I just found out, that it's easy to create permissions that are template based. The permission name must start with "page-". After you check the box on a template "Mangage edit access" (screenshot above), it becomes selectable under Access->Roles->Yourrole. You just have to click on the little arrow to open the settings first. Nice!
    2 points
  3. Haven’t thoroughly tested it or anything, but this hook seems to work: wire()->addHookBefore('ProcessPageEdit::execute', function(HookEvent $event) { /** @var Page $page */ $page = $event->object->getPage(); //ProcessPageEdit does roughly this to figure out if it’s dealing with a save request. if it isn’t, we don’t care if (!count($_POST) || (int)input()->post('id') !== $page->id) return; //if the page isn’t locked -> don’t care if (!$page->isLocked()) return; //if it’s locked and we’re a superuser, unlock if (user()->isSuperuser()) { $page->removeStatus(Page::statusLocked); wire()->message('leet hax, you just edited a locked page.'); //You don’t need to re-lock the page here, because the Locked checkbox is //sent with the page edit form, so saving will set it to the desired value } }); I would have hooked processSave directly, but it’s not hookable. Bonus tip: You can change the warning that says “This page is locked for edits” if you put this in the hook: if (user()->isSuperuser()) $event->object->noticeLocked .= ', but I’ll make an exception for you because you’re such a pleasure to be around'; Btw, you can always edit locked pages from the API as a superuser.
    2 points
  4. Modules Directory: https://processwire.com/modules/rock-frontend Github: https://github.com/baumrock/RockFrontend
    1 point
  5. Sure, just copy and paste this to your site $http = new WireHttp(); $region = $http->getJson("http://ip-api.com/json/{$session->getIP()}?fields=city,countryCode"); user()->setLanguage($region['countryCode']); //well… it’s not *this* easy. you’ll have to connect your languages to ISO 3166-1 alpha-2 country codes somehow echo '<marquee><blink>' . sprintf(__('Hot milfs looking to hook up in %s!'), $region['city']) . '</blink></marquee>';
    1 point
  6. Sorry, been away and lost your message. On this particular project I don't see anything there, just a message saying "No content migrations". But it doesn't seem to be related to any of this. I found some documentation here: https://craftcms.com/docs/4.x/extend/migrations.html
    1 point
  7. not intended to start a fight ... but here are my pro's for using uikit ... It's called controlled bias ??
    1 point
  8. I recommend starting with uikit ? Note that this post is not intended to start a fight on which one to use as this is always a matter of preference, but here are my pro's for using uikit ? You have plenty of ready to use ui components (as with any other framework): https://getuikit.com/docs/introduction You can use RockFrontend to get a 1-click-downloader as well as a solid setup and an example video to get you started: https://www.youtube.com/watch?v=7CoIj--u4ps The PW backend does also use UIkit, so knowing UIkit will help you a lot when customizing the PW backend to your needs (either via CSS/LESS or when implementing custom admin pages) UIkit has longer release cycles than bootstrap for example so for mee it just feels more solid than bootstrap for example, but that's very opinionated of course...
    1 point
  9. Mac OS 11.2.3. Browser is Chrome 104.0.5112.79. I am using MAMP Pro 6.6 There is something going on in the dev tools. I've got the feeling that something keeps triggering the autorefresh. I excluded all scripts and CSS but it keeps on refreshing.
    1 point
  10. Thx @Spiria for your kind words ? ? I'd need more information for that... What OS are you using? What browser? What does the devtools say? etc... Are you working with DDEV? XAMPP? Laragon etc..?
    1 point
  11. Innodb tables supports a maximum of 767 bytes for indexes, so floor(767/3) == 255 for utf8(mb3) and floor(767/4) == 191 for utf8mb4. So the index length should be set to 191 max. https://dev.mysql.com/doc/refman/8.0/en/charset-unicode-conversion.html
    1 point
  12. Nice to meet you all My name is Micthew, i'm from Indonesian, i am beginner in ProcessWire CMS ProcessWire CMS is great, i like to use ProcessWire CMS when i build some website. But in this Project, my client want his website have multilanguage feature, but in my country (Indonesian), English language isn't our basic language, we have our own language. So, how can i make multilanguage : Indonesian Language and English Language? 'Cause he said only 2 languages Thank you all, i hope you all can give me some enlightenment I'm apologize for my bad english language?
    1 point
×
×
  • Create New...