Jump to content

kaz

Members
  • Posts

    273
  • Joined

  • Last visited

Everything posted by kaz

  1. @Jan Romero "since" I added only for understanding, it's not the original content. It's not about birthdays, it's for company anniversaries like this: …, we have placed great value on personal advice for [[count_years]] years … therefore it is important that the full date Y-M-D added up the year.
  2. Great, and I don't need the entry in the Attributes Panel. Thanks!
  3. Hi, I would like to output the distance between a defined date and today in years. Example: 1980-07-01 (y-m-d) and today (current date, without time) calculate and echo via Hanna code. <?php $start = date('Y', strtotime($start)); $diff = date('Y')-$start; echo $diff; Attributes: start=1980 Page: <p>Hannah Code Test: since [[count_years]] years</p> count_years is the name of the Hanna Code. In my test, I tried it only with years, the result is: since 0 years so I had to put the month and day back for now. Code type is PHP code. I think the problem could be the PHP strtotime function? Maybe someone has calculated the distance in years between a fixed date and the current date with Hanna code, and might be able to help?
  4. I want to output the values from Leaflet Map Marker in the header. $site_settings are a global settings page: <meta name="geo.placename" content="<?php echo $site_settings->map->address; ?>"> <meta name="geo.position" content="<?php echo $site_settings->map->lat; ?>; <?php echo $site_settings->map->lng; ?>"> <meta name="ICBM" content="<?php echo $site_settings->map->lat; ?>, <?php echo $site_settings->map->lng; ?>"> The result remains blank: <meta name="geo.placename" content=""> <meta name="geo.position" content="; "> <meta name="ICBM" content=", "> The map works fine, is displayed. What is wrong with my header query? Edit: Error found, the field name map wasn't correct.
  5. @kongondo I will try that, thanks!
  6. A question for the developers who work on multiple projects at the same time: When working localhost on several projects at the same time, must the /wire folder be placed in the project folder for each project? Or is there a solution for developers that works by with a single /wire folder? Maybe a link in the config to a fixed /wire folder outside a respective project folder? If the environment has anything in common with it: I use the MAMP PRO macOS development solution.
  7. @LMD In one template, that's a great solution. Thanks a lot for this, it works perfect.
  8. I need an if else or if or else to check the following: There is a field aside in each page. A simple info field where you can store info "We are on vacation …". The content is displayed only on this page. Next, there is a settings_aside field in the Global Settings, which is displayed on all pages. The fields are called this way: <?php if ($page->aside) { include('views/blocks/block-sidebar.php'); } else { include('views/blocks/block-sidebar-settings.php'); }; ?> I want, if no field is filled, then nothing is displayed. If both fields has content, the aside field on this page takes precedence. On all other pages the settings_aside content is displayed. block-sidebar.php <div class="uk-card card-bg uk-padding-small uk-margin-small-bottom"> <h6 class="uk-margin-remove uk-text-uppercase uk-text-normal" style="letter-spacing: 1px; margin-bottom: .5rem !important;"><span uk-icon="icon: info"></span> Aktuelles</h6> <?=page()->aside?> </div> block-sidebar-settings.php <div class="uk-card card-bg uk-padding-small uk-margin-small-bottom"> <h6 class="uk-margin-remove uk-text-uppercase uk-text-normal" style="letter-spacing: 1px; margin-bottom: .5rem !important;"><span uk-icon="icon: info"></span> Aktuelles</h6> <?php echo $pages->get('1032')->settings_aside; ?> </div> Roughly it works, but unfortunately not 100 %. Unfortunately the h6 of the templates are displayed. That means I would have to query the headlines via if else with the fields (!?). Just where? In the templates, or in the first if/else query?
  9. When I move over the map with the Magic Mouse, the map zooms in / out. Can this be deactivated, the finger movement should be for moving up and down the page ;)
  10. After every login I receive this mail: Hi kaz, You just logged in from a device we haven't seen you use before. Browser and Mac are always identical …
  11. @horst I have never used the combo field. This is interesting, I tried to test it. I have defined a combo field 'setting' with a few subfields, company (setting_company), name, street, and so on. I created a template with these field, and assigned it to a new page. The echo is not working, I can't get the data. No error message, it just keeps empty. echo $page->setting->setting_company; echo $pages->get('1052')->setting->setting_company; The first line (Using your Combo field from template files) I have from: ProFields: Combo field. How do you retrieve the data, from the page, from the template, from the field?
  12. How do you set up global settings? I did it this way: I do a template settings (without php file). I made fields, company, name, city, phone, ... which are included in the template. Then I created a Settings page in the Tree with the Settings template, and declared the page as Hidden in the Page Settings. I retrieve the content via page ID. Is this a common way? How do you implement global settings?
  13. @Andy This works perfect, good job!
  14. @Andy Unfortunately, I could not find a solution with it to remove the link to the Global Setting either. At my complete code no URL is called at any point, I think that the module adds the link uncalled. Why, I have no idea. <?php $options = array( 'popupFormatter' => function($page) { $out[] = "<strong>Company</strong>"; $out[] = "Street"; $out[] = "ZIP City"; return implode('<br/>', $out); } ); echo $map->render($pages->get('1028'), 'settings_location', $options); ?> If someone like me calls the data from Global Settings I would appreciate your feedback. How did you defined it? // Edit: I find a solution in a post from 2017: In MarkupLeafletMap.js, I changed the code marker.bindPopup("<b><a href='" + marker.linkURL + "'>" + title + "</a></b>" + extra); to marker.bindPopup("" + extra + ""); Then the line breaks: extra = '<br />' + extra; to extra = '' + extra;
  15. It's a good consideration. I set it up this way: I have a base template. In it I load per include the news template. The news template has only the code I need to display the articles. I only have a summary, because I didn't manage to build the whole thing including a detail page. I have activated Allow Page Numbers only in the included news template.
  16. @netcarver I have the same result with this code (plus an additional unformatted list above the pagination? $results = $pages->find("limit=5, template=news, sort=-publish_from"); echo $results->render();
  17. @netcarverAllow Page Numbers was already activated. Without activation the pagination would not work (!?), but it works. Only the link to the pages, the URL, I think is wrong <a href='{url}'><span>{out}</span></a>. The link is surely not wanted like that: ?page=2
  18. I have for a news site (Lister Pro) a pagination with MarkupPagerNav. $results = $pages->find("limit=5, template=news, sort=-publish_from"); echo $results->renderPager(array( 'nextItemLabel' => "vor", 'previousItemLabel' => "zurück", 'listMarkup' => "<ul class='MarkupPagerNav uk-margin-medium-top'>{out}</ul>", 'itemMarkup' => "<li class='{class}'>{out}</li>", 'linkMarkup' => "<a href='{url}'><span>{out}</span></a>" )); The pagination is displayed but does not work. The link is output as follows: http://192.168.64.2/news/?page=2 When I click the link, the same page is reloaded, not page 2. I have 7 entries, with limit 5, 5 entries are correctly displayed on news page 1. I am worried about the news/?page=2, shouldn't it be news/page2 ?
  19. @diogo I have no output. Simply nothing happens … <?php echo setlocale(LC_ALL, 'de_DE.UTF8', 'de.UTF8', 'de_DE.UTF-8', 'de.UTF-8', 'de_DE@euro', 'de_DE', 'de', 'ge'); ?>
  20. I'm sorry: The echo has no output, not in frontent, not in source code. My entry in C is: de_DE.UTF8, de.UTF8, de_DE.UTF-8, de.UTF-8 localhost is: // setlocale(LC_ALL, 'de_DE.UTF8', 'de.UTF8', 'en_GB.utf8', 'en.UTF-8'); setlocale(LC_ALL, 'de_DE.UTF-8'); I work localhost with XAMPP, macOS. I have no experiences with SSH. Sorry about giving up. But when I don't see a change, then perhaps I give up too quickly.
  21. @diogo it does not work, the error remains. No matter what I do, it doesn't change anything. The problem is probably in my system? Thank you for trying to help, but I don't want to try any more.
  22. C This was already done before I posted the article, the entry C is de_DE.UTF8, the default language. All entries are included. de_DE.UTF8 in 'C' Translate LanguageSupport.module, setlocale(LC_ALL, 'de_DE.UTF-8'); in config.php The error message remains.
  23. I have tried everything, I give up. The page works properly, the error is nonsensical, just a small blemish for the administrator.
  24. I did try it with: setlocale(LC_ALL, 'de_DE.UTF8', 'de.UTF8', 'en_US.UTF-8', 'en.UTF-8'); in config.php + cleared cache Then I tried adding the setting of the languages in the Translate LanguageSupport.module: de_DE.UTF8, de.UTF8, en_US.UTF-8, en.UTF-8 + cleared cache I have restored the entry in the config to setlocale(LC_ALL, 'de_DE.UTF-8'); The error message remains. Perhaps a short explanation of the page: I have replaced the default language to German, including installation of the language packs. A second language is not installed yet, is planned for later. The fields of the templates are already set to *Language, because it was possible after installing the language, a step in preparation for the second language.
  25. @Chris Bennett I had already both entries in the config, the message remains. $config->timezone = 'Europe/Berlin'; setlocale(LC_ALL, 'de_DE.UTF-8');
×
×
  • Create New...