Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/15/2021 in all areas

  1. A module helping you to manage SEO related tasks like a boss! Automatically generates and maintains a XML sitemap from your pages. Includes a Fieldtype and Inputfield to manage sitemap settings and meta data for pages (Title, Description, Canonical URL, Opengraph, Twitter, Structured Data etc.) Multi language support for the sitemap and meta data. Configure default values for meta data on template level and let pages inherit or overwrite them individually. Map existing fields to meta data, reducing the need to duplicate content. Live preview for content editors how the entered meta data appears on Google. Live preview for content editors how the entered Opengraph data looks like when sharing a page with Facebook. Check out the README on GitHub for more details, including usage instructions. The module is currently released as beta and needs testing! Please report any issues on GitHub or in this forum thread, if you find time to give it a try ? Examples Here is an example of rendered meta data you will get from a single SeoMaestro field: <title>Sed dictum eros quis massa semper rutrum. | acme.com</title> <meta name="description" content="Si lobortis singularis genitus ibidem saluto. Dolore ad nunc, mos accumsan paratus duis suscipit luptatum facilisis macto uxor iaceo quadrum. Demoveo, appellatio elit neque ad commodo ea. Wisi, iaceo, tincidunt at commoveo rusticus et, ludus."> <meta name="keywords" content="Foo,Bar"> <link rel="canonical" href="https://acme.com/en/about/"> <meta property="og:title" content="Sed dictum eros quis massa semper rutrum."> <meta property="og:description" content="Si lobortis singularis genitus ibidem saluto. Dolore ad nunc, mos accumsan paratus duis suscipit luptatum facilisis macto uxor iaceo quadrum. Demoveo, appellatio elit neque ad commodo ea. Wisi, iaceo, tincidunt at commoveo rusticus et, ludus."> <meta property="og:image" content="https://acme.com/site/assets/files/1001/og-image.jpg"> <meta property="og:image:type" content="image/jpg"> <meta property="og:image:width" content="1600"> <meta property="og:image:height" content="1200"> <meta property="og:image:alt" content="Lorem Ipsum"> <meta property="og:type" content="website"> <meta property="og:url" content="https://acme.com/en/about/"> <meta property="og:locale" content="en_EN"> <meta name="twitter:card" content="summary"> <meta name="twitter:creator" content="@schtifu"> <meta name="twitter:site" content="@schtifu"> <script type="application/ld+json"> { "@context": "https://schema.org", "@type": "BreadcrumbList", "itemListElement": [ { "@type": "ListItem", "position": 1, "name": "About", "item": "https://acme.com/en/about/" } ] } </script> <meta name="generator" content="ProcessWire"> <link rel="alternate" href="https://acme.com/en/about/" hreflang="en"> <link rel="alternate" href="https://acme.com/en/about/" hreflang="x-default"> <link rel="alternate" href="https://acme.com/de/ueber/" hreflang="de"> <link rel="alternate" href="https://acme.com/fi/tietoja/" hreflang="fi"> And some screenshots of the UI:
    1 point
  2. @Ivan Gretsky You can also try next version of Mystique field type. Now, its possible to display custom fields depend on template name or page, you imagine it. Here is an example usage: <?php namespace ProcessWire; /** * Resource: magic of mystique field */ return function ($page = null, $field = null, $value = null) { $fields = [ 'hello' => [ 'label' => 'Are you ready for a Magic ?', 'type' => 'select', 'options' => [ 'no' => 'No', 'yes' => 'Yes' ], 'required' => true, 'defaultValue' => 'no' ] ]; if ($page instanceof Page && $page->template->name == 'page') { $fields['current_page'] = [ 'label' => 'Current page title : ' . $page->title, 'value' => $page->title, 'showIf' => [ 'hello' => '=yes' ], 'columnWidth' => 50 ]; } if ($field instanceof Field) { $fields['current_field'] = [ 'label' => 'Current field label : ' . $field->label, 'value' => $field->label, 'showIf' => [ 'hello' => '=yes' ], 'columnWidth' => 50 ]; } return [ 'name' => 'magician', 'title' => 'Do A Magic ?', 'fields' => $fields ]; };
    1 point
  3. This should work <?php $page->of(false); $page->mystique_field_name->property1 = 'data'; $page->mystique_field_name->property2 = 'data'; $page->mystique_field_name->property3 = 'data'; $page->mystique_field_name->property4 = 'data'; $page->mystique_field_name->property5 = 'data'; $page->mystique_field_name->property6 = 'data'; $page->save();
    1 point
  4. Thanks for the reply and for the module, that seems to solve important problem for many PW users. Will be glad to test things if you manage to find time to work on improvements. And I still think the module is worth being in the modules list for better discoverability.
    1 point
  5. You must be looking for $sanitizer->pageName() (probably, with beautify parameter set to Sanitizer::translate).
    1 point
  6. Hi, i don't know if it's what you are looking for but in pw, you have a setting tab for each page where you can set whatever name you want, even completely different from the page title a little trick that may help, when creating a page pw auto fill the name field based on the title you choose, what i do when i want them different, i first fill the name and the title afterwards ? have a nice day
    1 point
  7. Hi neophron, sorry for the year-late answer. I think the first part of your structure, up to the "... will be redirected" (more on that in a bit), is managable in ProcessWire. I have a(n old) MultiSite setup that basically is the same. I have not bothered about the language at all in the $config->MultiSite, and have the what you call subdirectories, managed with the MultiLanguage set up, where I can define the "slots" for the language on the root (pid=1) page. this results in mydomain.global/ => / is the "name/slot" of the default language (en) mydomain.global/de/ => /de/ s the "name/slot" of the first language (de) mydomain.global/it/ => /it/ the "name/slot" of the 2nd language (it) and so on. In the $config->MultiSite: $config->MultisiteDomains = array( "mydomain.global" => array( // domain name is used to map to root page "root" => "mydomain.global", // page name for the root page "http404" => 27 ), "mydomain_second.global" => array( // domain name is used to map to root page "root" => "mydomain_second.global", // page name for the root page "http404" => 27 ), This works fine. What I haven't tried yet, is to redirect in one of those domains directly to a translation. I could do this with a .htaccess rewrite or maybe with a session->redirect() in ProcessWire, but with the inherited set up that "/" is the default language, AND a redirect from "/" -> "/de/" for example, it is difficult to switch back to the default language on that site. I wonder if "mydomain.global" => array( "root" => "mydomain.global/de/", "http404" => 27 ), would work, though. EDIT: nope. this does not work, I just tested it
    1 point
  8. Hi. https://github.com/processwire/processwire/blob/master/wire/core/Templates.php#L303 So it looks like cloning of the template doesn't clone fields context for template fieldgroup. You can do it by api like $sourceFieldgroup = $fieldgroups->get('service'); $newFieldgroup = $fieldgroups->get('test'); foreach ($sourceFieldgroup as $field) { if($sourceFieldgroup->hasFieldContext($field) && $newFieldgroup->hasField($field)) { $contextArray = $sourceFieldgroup->getFieldContextArray($field->id); $newFieldgroup->setFieldContextArray($field->id, $contextArray); } } $newFieldgroup->saveContext(); Probably there is better way but it worked for my case.
    1 point
  9. Alternatively someone could build/generate a docset from the php sources for usage in dash or zeal. No stars required. https://zealdocs.org/ / https://kapeli.com/dash https://kapeli.com/docsets
    1 point
  10. Not sure if this is documented anywhere, but you can use the RepeaterMatrixPage::matrix() to get the label: // get the label in the current language $page->my_repeater_matrix_field->first()->matrix('label'); In recent versions of RepeaterMatrix, you can also call RepeaterMatrixPage::getMatrixInfo() to get an array of information, including the label: $page->my_repeater_matrix_field->first()->getMatrixInfo();
    1 point
  11. $pageArray->has($page); http://processwire.c...er=has Also it doesn't matter if you add duplicates as PW will remove them anyway.
    1 point
  12. Dave, You can add whatever fields you want to the user template. I'm building a fairly complex user profile setup as well. Go to: Setup > Templates, at the top of the page open the "filters" area and enable "show system templates". Now you can add any of your fields to the user template.
    1 point
×
×
  • Create New...