-
Posts
1,399 -
Joined
-
Last visited
-
Days Won
17
Everything posted by Juergen
-
Hi, I am struggeling with a problem to set the robots metatags (noIndex, noFollow) within a before page save hook. Here is my code (inside ready.php): $pages->addHookBefore('save', function($event) { $page = $event->arguments('page'); if($page->template == 'privacy-policy' || $page->template == 'search' || $page->template == 'error') { //SEO Maestro $page->seo->sitemap->include = 0; $page->seo->sitemap->priority = ''; //How to set robots to no index and no follow //??????????? } }); I could not figure out a way to accomplish this. Can anyone help me out? Thanks
-
Thank you @Wanze for the additions (especially for the structured data)!!
-
I wanted to create a HTML Sitemap with the same pages as the XML sitemap. Unfortunately the $pages->find() method doesn´t support the order of the page tree, so I could not use the provided function to get all pages from the XML-Sitemap in the same order as the page tree. $pages->find('seo.sitemap_include=1'); So I wrote a little recursive function to render all the pages except the ones which were not included in the XML sitemap. The pages have the same order as in the page tree. function renderSitemap($items, $depth = 0) { $separator = ''; for ($x = 0; $x <= $depth; $x++) { $separator .= '-'; } foreach ($items as $item) { if ($item->seo->sitemap->include == 1) { $subitems = $item->children(); if (count($subitems)>0) { echo '<b>'.$separator.$item->title . '</b><br />'; } else { echo $separator.$item->title . '<br />'; } $subitems = $item->children(); renderSitemap($subitems, $depth+1); } } } //OUTPUT INSIDE TEMPLATE FILE $items = $pages->get("/")->children(); echo '-'.$pages->get("/")->title.'<br />';//this is only for the homepage renderSitemap($items); This little function is not intended as a complete HTML sitemap markup generation solution. It only outputs the title of the pages (without links). It should only be a starting point for others to show you how to use SEOMaestro settings in combination with a frontend sitemap. Maybe if someone has a better solution it would be great if you post it here. Best regards This is what it looks like:
-
Hello @Peter Knight I think that there is no render tag method for the robot tags, but you can use the following: $page->seo->robots->data['noIndex'] $page->seo->robots->data['noFollow'] This returns true if 'no index' was choosen and true if 'no follow' was choosen. Create the meta tags by yourself and use PHP to fill in these values into the meta tags. Best regards Jürgen
-
I have not installed this module and I have the same problem. On my current installation I have only installed a few modules. So I guess it has nothing to do with other modules.
-
Thank you @Wanze for this great module. Only one thing to mention: From the point of security it is not recommended to add the generator metatag (or any other information to help hackers to know something about the system). So it would be great to add a setting checkbox to disable the rendering of this metatag. I know I can render each metatag separately but using your render method ($page->seo->render()) would be much more comfortable ?. Best regards Jürgen
-
If I understand you correctly, you have added a new image field to your template for the featured image and you need the url for the src attribute. ? Lets assume the name of the new image field is 'featured_image' you will get the url of this image by using $page->featured_image->url So the code of the blog-post.php could look like this: <?php $img = $page->featured_image; if($img) { $img = $img->width(600); echo "<p class='uk-text-center'><img src='$img->url' alt='$img->description'></p>"; } ?> Image is an object, so you have to grab the different values (attributes) of the image by using the arrows (->) followed by the name of the attribute (size, url,...). You will find more information about getting image values here If this was not the information you are asking for please post your code for better understanding. Best regards
-
Module: AIOM+ (All In One Minify) for CSS, LESS, JS and HTML
Juergen replied to David Karich's topic in Modules/Plugins
Hello, I always get this warning with Tracy: PHP Warning: A non-numeric value encountered in .../site/modules/AllInOneMinify/AllInOneMinify.module:713 This is the line of code: $_timestamp = ($_timestamp + $file['last_modified']); It seems that one of the two values is not in the right format. Best regards -
Thanks @adrian for the quick fix!! It works as expected! ?
-
Hello @adrian is it possible to disable the input field length fe style="width:60px;" by entering something into the settings field? If not, it would be great if you add the possibility to enter fe a "-" to disable the rendering of the style attribute. This could be useful if you are using the UIKit template because there are various input length classes ('uk-form-width-medium'....) and you dont need the input field length. Best regards Jürgen
-
[SOLVED] How to display field's label on error messages?
Juergen replied to PWaddict's topic in General Support
Thanks for the hint! -
Hello @ all, only a simple question: Is it possible (and if how) to distinguish if a page was saved via fe a save ready hook or manually by pressing the save button? I have the problem that a special hook function should only run if the save button was pressed by a human. In my case the schedule pages module triggers a hook to set a child page status to unpublished and saves the child page and this save process leads to start another hook which changes some values in the parent page. I only want to run this hook for the parent page if the child page was saved by pressing the save button and not by saving via a hook. if(Save button was pressed) { // run the hook } else { // do not run the hook } Maybe someone has struggled with the same problem and can give me a hint how to deal with this? Best regards
-
[Solved] Adding a label to image field description input
Juergen replied to LMD's topic in General Support
@dragan On my screen the label "Description" is also not visible. It is also not visible in the sourcecode. I am using PW dev version 101 (latest). Same for the tags label if I enable them. Admin Theme UIKit. Best regards- 6 replies
-
- images
- image field
-
(and 1 more)
Tagged with:
-
It would be great if an optional text field will be added to the inputfield integer to add additional text next to the integer field (fe. weeks, days,..). Multilanguage support would be nice .
-
Bug column width in UIKit admin template using if conditions
Juergen replied to Juergen's topic in General Support
Hello @Robin S Thanks for this information. I have set the width of the last 2 cols to 17% and now it works. It doesn`t seem very logical to me, because I have thought that the width of the non visible col will be automatically set to 0%, but dividing it by two solves the problem. Thousand thanks, you have made my day!! Would be great if this info will be added to the docs. -
Bug column width in UIKit admin template using if conditions
Juergen replied to Juergen's topic in General Support
Thanks @ryan I have downloaded the uikit admin template from the dev branche, but unfortunately the problem is still there. Now it is not in the last column but in the second one. Afterward I will try to show you what happens. These are the column widths in my template settings for the 4 fields. Remember the last 2 fields changes depending on the option selected in the second field. So the field named "repeatuntilmonthtype" is a select option field. Depending on its settings the field "repeatuntilmonthnumber" or "repeatuntilmonthdate" will be displayed. Both field have a length of 34% to fit 100% at all. On the first view everything looks ok: Here are the corresponding CSS-classes for each column (from first to last) which were added to the li-tag: First row: Inputfield InputfieldInteger Inputfield_repeatmonthsnumber InputfieldStateRequired InputfieldStateRequiredIf InputfieldColumnWidth InputfieldColumnWidthFirst uk-first-column uk-width-1-3@m InputfieldRowFirst Second row: Inputfield InputfieldSelect Inputfield_repeatuntilmonthtype InputfieldStateRequired InputfieldColumnWidth InputfieldStateChanged uk-width-1-3@m InputfieldRowFirst Third row: Inputfield InputfieldInteger Inputfield_repeatuntilmonthnumber InputfieldStateShowIf InputfieldStateRequiredIf InputfieldColumnWidth uk-width-1-3@m InputfieldColumnWidthLast InputfieldStateRequired InputfieldRowFirst After changing the option in the select field (field in column 2) it looks like this: So this looks like the same problem like in my post before: Here are the CSS-classes: First row: Inputfield InputfieldInteger Inputfield_repeatmonthsnumber InputfieldStateRequired InputfieldStateRequiredIf InputfieldColumnWidth InputfieldColumnWidthFirst uk-first-column uk-width-1-3@m InputfieldRowFirst Second row: Inputfield InputfieldSelect Inputfield_repeatuntilmonthtype InputfieldStateRequired InputfieldColumnWidth uk-width-2-3@m InputfieldStateChanged InputfieldRowFirst Third row: Inputfield InputfieldDatetime Inputfield_repeatuntilmonthdate InputfieldStateShowIf InputfieldStateRequiredIf InputfieldColumnWidth InputfieldColumnWidthFirst uk-first-column InputfieldNoFocus InputfieldColumnWidthLast uk-width-expand InputfieldStateRequired uk-grid-margin Please notice the CSS-class of the second field has changed to "uk-width-2-3@m" which should be "uk-width-1-3@m". The CSS class of the last column is now correct with "uk-width-expand", but "uk-width-1-3@m" should be better. So the main problem is now in the CSS class of the second column. Previously the problem was located in the third (last) column. Only to mention: All these fields will only be displayed if a checkbox is set to true (another dependency). I dont know if this is important to know or not. Best regards Jürgen -
Hello @adrian, I have implemented your fix and for the moment everthing seems to work fine. If I discover any issues I will post it. Thanks
-
Hello @adrian I am not sure if I am doing the check right: I added the bd function on line 193 on ProcessCustomUploadNames.module file (remember the notice message points to line 194) I check the variables by using bd($file), bd($repeater) and bd($rf) on that line. The results are: 1) bd($file): 2) bd($repeater): 3) bd($rf): I hope this could be helpful to you - but maybe I have done something wrong during the check. Best regards
-
Its late here in Austria. I will take a look tomorrow.
-
Hello @adrian, sorry for the long delay, but I was 12 hours at work. I am sorry, but I dont know how to check which triggers that.The strange thing is that the notice disappears if I refresh the same page. After a while the error appears again. This happens on different pages with one or more pictures.
-
Hello @adrian could you please check this notice: PHP Notice: Trying to get property of non-object in .../ProcessCustomUploadNames.module:194 Thanks
-
Bug column width in UIKit admin template using if conditions
Juergen replied to Juergen's topic in General Support
Thanks @Robin S I havent seen this. -
Hello I want to know if others have discovered the same issue with the UIKit admin theme. If you want fe 3 cols in a line and if you have a "show if condition" the grid will not be added correctly. Take a look at the following images. 1) Everything is ok. Each column width was set to 33%. The last field in the column has a dependency to the field in the second column. After changing the select value of the second field the following happens: As you can see the third field which should be 33% float to the next line and has the UIKit class "uk-width-2-3@m" instead of "uk-width-1-3@m" or "uk-width-expand". Can someone confirm this behaviour?