Jump to content

Wanze

PW-Moderators
  • Posts

    1,116
  • Joined

  • Last visited

  • Days Won

    10

Everything posted by Wanze

  1. Wanze

    SeoMaestro

    Just noticed that the module does not work correctly on single language installations, as I always tested on multi language setups. Should be easy to fix though, I know what the problem is ? Cannot fix it today, so if you are testing, you might want to test with multiple languages. Sorry for this, I obviously should have tested this myself. Cheers!
  2. 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:
  3. @tiefenbacher_bluetomato You can us the following hook to extend the smarty object: wire()->addHookAfter('TemplateEngineSmarty::initSmarty', function (HookEvent $event) { $smarty = $event->arguments('smarty'); // Register your function here });
  4. @Sten In home.twig, the block engagement block is nested inside the home block. In engagement.twig, this is not the case. Does it work if you either move it out of the home block in your parent template; or recreate the nested block structure in engagement.twig.
  5. @Sten Your twig templates look fine, the problem is the global template file setting. Just leave that config empty. This is a "global setting" of the TemplateEngineFactory which is supported by all engines, but actually makes no sense in Twig and generally in engines supporting template inheritance. It was introduced by a feature request, but now I think it's more confusing than useful. Cheers
  6. Hi @Sipho MarkupRegions is currently only processed during Page::render(). TemplateEngineProcessWire uses TemplateFile::render() to return the markup, where MarkupRegions are not recognized/populated. Here are the relevant lines: https://github.com/processwire/processwire/blob/master/wire/modules/PageRender.module#L521-L526 It should be possible to integrate this logic into TemplateFile::render via hooks. Unfortunately I do not have much time for ProcessWire these days ? I'm happy to accept a pull request though Cheers
  7. That's correct. The output from Twig is cached as static file and if present, ProCache directly serves this via .htaccess.
  8. Hi @Sipho Sorry I missed your post. I don't know/use markup regions myself, so it's hard for me to help. Does your code work if you disable the TemplateEngineFactory module? If it works, then somehow markup regions are not respected when your ProcessWire templates are getting rendered by this module. I try to look into this at the end of this week. Cheers
  9. @gmclelland Twig sometimes has problems when you try to access a property via magic getter. I consistently use $page->get('my_field') to avoid this issue. So in your example, you could use {{ post.get('event_description') }}.
  10. Hi @davenorton Welcome to ProcessWire! It is a scope problem: The $pages variable is not known inside your function by PHP. Use the global wire() function to get any API variable. At the beginning of your function, write this: $pages = wire('pages'); And it should start to work. Cheers
  11. @gmclelland I noticed the same problem on a project of mine. I tried to fix this with the latest release of the TemplateEngineFactory module (1.1.2). If you throw a Wire404Exception() the module now should set the correct 404 page for twig. So the redirect should not be necessary now.
  12. Hi @ak1001 Thanks! 1. Do not delete /site/templates/home.php. This file now acts as a "controller" and you will pass variables to your twig templates via $view. 2. You don't need this file, the corresponding twig file would be in /site/templates/views/home.html. Note that this path and the file extension depend on your module configuration. 3. Yes, this is actually your twig template. The below code belongs to /site/templates/home.php <?php $view->set("myvar", "my test var"); Think of this file as layer between ProcessWire and your twig template. So instead of echo stuff there, pass it to the twig template which takes care of the rendering. Hope that helps! Cheers
  13. Hi @Menz Sorry for my late response, I was traveling a longer time while you were posting this. I would be interested if you could solve it using the module? There is another approach which let's you control the caching: 1. Do not create a corresponding smarty template so that the module does not attach the render hook. This means that the controller aka regular ProcessWire template will work just normal. Let's call this template filter_response.php. 2. The filter_response.php can still use the factory to create the markup via Smarty but at the same time control the caching via WireCache. Something like this (inside site/templates/filter_response.php) if ($cached = $cache->getFor('my_namespace', $page->id) { echo $cached; } else { $tpl = $factory->load('filetered_response_template'); $tpl->page = $page; $output = $tpl->render(); $output = filter_output($output); $cache->setFor('my_namespace', $page->id, $output); echo $output; } Cheers
  14. @jtborger You could try to hook before Pages2Pdf::___createPDF() and change the page orientation based on the pages template: wire()->addHookBefore('Pages2Pdf::createPDF', function($event) { $page = $event->arguments('page'); $pages2pdf = $event->object; if ($page->template->name === 'your template') { $pages2pdf->getPDF()->set('pageOrientation', 'L'); } }); I'm not sure if it works though and I did not test if the above code is correct. Maybe it helps you to get started Cheers
  15. A little information for the observers here: The feature to view a secret file beside the forced download is now available in version 1.0.3. Thanks @Macrura! I introduced an additional setting on field level to toggle the "View" possibility. Cheers
  16. @FrancisChung You could try to use the version of the module available on the "dev" branch, which uses a newer version of mPDF: https://github.com/wanze/Pages2Pdf/tree/dev I really should merge to master... could you report back if it works and if not, what kind of issues you are facing? Cheers
  17. @Macrura Muchas gracias for your additions! Could you open a pull request against the "dev" branch? I would like to integrate your features Cheers
  18. @maxf5 Can you check if the image is existing on your hard drive by looking at the file in /site/assets/files? Recently I had a problem in ProcessWire that my thumbnails were not getting generated correctly if I was using numbers like 100,200,300,400 for the dimensions. Strangely it worked by using other dimensions like 110, 390 etc.
  19. What PHP version are you using? These kind of errors make me guess that mpdf is not compatible with your PHP version. Can you try to use the dev branch of the module via GitHub?
  20. I meant the active smarty template when you pass data in your controllers, e.g. $view->set('title', $page->title); The convention of the module is that the smarty template has the same name as the controller, e.g. home.tpl for your home.php file.
  21. No The global template file has nothing to do with smarty, it is a feature provided by the module that is available for all connected template engines. The global template file only means that you always get the same (smarty|twig|...)-template behind the $view API variable. As already said, you probably don't want to use a global template file with smarty, because you can use smartys template inheritance which is much more powerful. For me, this is the main reason to use a template engine.
  22. @Manaus Can you provide some example code? Unfortunately I do not understand what you mean by "no block is being passed". Is it possible you are mixing up features of the template engine with the module? In smarty, you use the {block} tags to define sections that are either inherited or overwritten in a child template. To overwrite a block, you must use {extends} in your child template. If you provide some code I'm sure I can help you Cheers
  23. This means that you will have the same smarty template behind the $view variable. Normally, each controller (ProcessWire template) has its own template, e.g. home.php --> home.tpl basic-page.php --> basic-page.tpl However, with smarty you do not need this feature. You can make use of template inheritance, so create a global "layout.tpl" and define your blocks. Then, in your child templates you can overwrite these blocks. Hope it helps! Cheers
  24. This block thingy are features of the template engines (twig, smarty, jade...). ProcessWire does not offer this, you may look at regions, though I've never used them. This module does not implement any new features, it just serves to connect different template engines to ProcessWire and to use them via a common interface. If you use ProcessWire as template engine, you get all the features of ProcessWire templates: http://processwire.com/api/templates/ Cheers
  25. Did you check the settings in the WirePDF module? You can define the margin there, which should be the same for all pages. If it is not working on just one page, there might be a problem with the markup. Maybe you can introduce some manual page breaks for testing this, please see the mpdf documentation for this feature.
×
×
  • Create New...