-
Posts
1,348 -
Joined
-
Last visited
-
Days Won
16
Everything posted by Juergen
-
Hello Adrian, thanks for the great update! In my case it seems that the field description and notes will not be outputted in the backend. Can someone confirm this behavior? Best regards
-
Can you compare my settings to yours, because in my case it works well. I have my JS custom file located in the folder "ckeditor". Path to the JS-file entered in the input: mystyles:/site/templates/ckeditor/mystyles.js and in the mystyles.js I have fe UIKit styles like these: CKEDITOR.stylesSet.add( 'mystyles', [ { name: 'Inline Code', element: 'code' }, { name: 'Inline Quotation', element: 'q' }, { name: 'Bild links', element: 'img', attributes: { 'class': 'align_left' } }, { name: 'Bild rechts', element: 'img', attributes: { 'class': 'align_right' } }, { name: 'Bild zentriert', element: 'img', attributes: { 'class': 'align_center' } }, { name: 'Small', element: 'small' }, { name: 'Text durchstreichen', element: 'del' }, { name: 'Inserted Text', element: 'ins' }, { name: 'Cited Work', element: 'cite' }, { name: 'Highlight', element: 'mark' }, { name: 'Einfügen', element: 'ins' }, { name: 'Sample', element: 'samp' }, /* Uikit headlines */ { name: 'unterstrichen', element: 'h3', attributes: { 'class': 'uk-heading-divider' } }, { name: 'Linie in der Mitte', element: 'h', attributes: { 'class': 'uk-heading-line' } }, { name: 'Kugel am Anfang', element: 'h', attributes: { 'class': 'uk-heading-bullet' } }, /* Uikit paragraphs */ { name: 'Kleine Schrift', element: 'p', attributes: { 'class': 'uk-text-small' } }, { name: 'Große Schrift', element: 'p', attributes: { 'class': 'uk-text-large' } }, { name: 'Nur Kleinbuchstaben', element: 'p', attributes: { 'class': 'uk-text-lowercase' } }, { name: 'Nur Großbuchstaben', element: 'p', attributes: { 'class': 'uk-text-uppercase' } }, { name: 'Erster Buchstabe groß', element: 'p', attributes: { 'class': 'uk-text-capitalize' } }, { name: 'Farbe: gedämpft', element: 'p', attributes: { 'class': 'uk-text-muted' } }, { name: 'Farbe: Primär', element: 'p', attributes: { 'class': 'uk-text-primary' } }, { name: 'Farbe: Erfolg', element: 'p', attributes: { 'class': 'uk-text-success' } }, { name: 'Farbe: Warnung', element: 'p', attributes: { 'class': 'uk-text-warning' } }, { name: 'Farbe: Gefahr', element: 'p', attributes: { 'class': 'uk-text-danger' } }, /* ul classes */ { name: 'Liste mit Kugel', element: 'ul', attributes: { 'class': 'uk-list uk-list-bullet'}}, { name: 'Liste mit Linie', element: 'ul', attributes: { 'class': 'uk-list uk-list-divide'}} ] ); Here is a screen shot of the custom styles dropdown: So in my case I didnt find it difficult to add styles
-
how do I add site navigation if starting on the blank template?
Juergen replied to Simon Love's topic in Getting Started
If you want a navigation different from the page tree you can write it also in HTML and add it to the template. Theres no need to use a function to create it. You can get the URL for a page in this way: $url = $pages->get(Id of the page)->url; fe. if the page has the id 45 you get the url like this: $url = $pages->get(45)->url; You can use it to write the menu in HTML and add the URLs with PHP like this <a href="<?php $pages->get(45)->url;?>"><?php $pages->get(45)->title;?></a> This outputs the link and as linktext the title of the page. There are many ways to create a navigation. I recommend you to take a look at the cheatsheet. -
Getting tab label in different languages on frontend fails
Juergen replied to Juergen's topic in API & Templates
Ok, I ended up with the following codes in site/_init.php //get labels, title, values and descriptions in different languages if ($user->language->name != 'default') { $title = "title{$user->language}"; $value = "value{$user->language}"; $label = "label{$user->language}"; $description = "description{$user->language}"; $notes = "notes{$user->language}"; } else { $title = 'title'; $value = 'value'; $label = 'label'; $description = 'description'; $notes = 'notes'; } and on the page itself: echo $page->template->fields->getFieldContext('tab1')->$label; Pay attention to "$label" instead of "label". The same can be achived by using description, notes,.... -
Getting tab label in different languages on frontend fails
Juergen replied to Juergen's topic in API & Templates
I use the latest DEV and PHP 7. Just to clearify: My tab field is type of "FieldsetTabOpen". -
Getting tab label in different languages on frontend fails
Juergen replied to Juergen's topic in API & Templates
Strange, in my case it outputs nothing with the same code and Tracy doesnt complain about anything. -
Getting tab label in different languages on frontend fails
Juergen replied to Juergen's topic in API & Templates
Sorry this was only a writing mistake. In the original code the comma is present. -
Getting tab label in different languages on frontend fails
Juergen posted a topic in API & Templates
Hello @all, I have tried to output the overridden label from a specific tab inside my template on the frontend. I have used this documentation: https://processwire.com/api/ref/template/get-tab-label/ The tab name is called "tab1" and the labels were overriden with "Kontakt" (German) and "Contact" (English). To output the label depending on the language on the frontend I use the following code snippet: $tablabel = $page->template->getTabLabel('tab1'); echo $tablabel; and $tablabel = $page->template->getTabLabel('tab1', $user->language->id); echo $tablabel; But both versions output only the default (German) tab label. I appreciate your help. Is there something that I am missing? But both version output an empty string, so it seems that the overridden values will not be taken into account. -
Its a shared host. It says true. For the moment I have disabled this module because the loading time of the page increases significantly.
- 30 replies
-
- antispiders
- anticrawler
-
(and 2 more)
Tagged with:
-
@flydev It means "The waiting time for the connection has expired"
- 30 replies
-
- 1
-
-
- antispiders
- anticrawler
-
(and 2 more)
Tagged with:
-
Just to clearify: I think the first aim of this inputfield should be a clean UI for entering business hours in an easy way (and in this case you made a great job). The next step is to provide the API calls to get the opening times for each day (like you have also done). So every opening time of each day can be indivdually outputted, formatted, styled or used for further PHP operations. Offering some nice additional API-calls for getting some additional information (whether it is open or not) is great, but can be achived with other libraries or PHP coding too and should only be an addon (not really necessary). So an additional input field for opening times on natural holidays is enough. We can use the value to make further operations (fe to check if this day is a nat. holiday or not by using fe. the Yasumi library) -> thats up to us as site developers and should not be an issue you have to deal with. Not everyone needs this feature. Best regards
-
Here is another library that I use to get public holidays for each country, but dont make it too complicated. https://github.com/azuyalabs/yasumi Its only a possibility to get holidays of each country without entering them inside an textarea input. The big problem of holidays is that they can change from year to year (fe. Eastern) So my thought is to include only an additional input field for the opening times on a public holiday (like the other days of the week). Everyone can include the libraries I have mentioned if there is a need (like I have done with your input field). The new inputfield can be used to output the opening times for holidays like the other days of the week. Include a hint that holiday times will be not included in your output functions like this Keep it as simple as possible. Here is a screenshot of how I did it. The values of the opening times come from your field. If it is open today or not, comes from the Spatie library, so it will be no problem for developers to include it . In addition a hint will be shown, when the business is open the next time (comes also from Spatie library) In my case I only use your input field for entering the business hours. Everything on the frontend side (output) comes from the Spatie library.
-
Most of the time I use this library for business hours. You can take a look at it: https://github.com/spatie/opening-hours This will take care of exceptions (like public holidays)
-
Hello @thuijzer, I dont know if others agree with me, but I would find it useful if an extra input field for public holidays will be added after Sunday. Fe in the gastronomy there is often the scenario that the business is open on public holidays. Here in Austria most of the time restaurants are closed on Monday, but if it falls on a public holiday they are open. So an extra field will take care of this. If the field will be left blank business is closed on a public holiday. Best regards
-
Add additonal settings to image field in template context
Juergen replied to Juergen's topic in API & Templates
I have set the $config->advanced = true; and remove the hook. This works great but thanks for your tipp. -
Hello, it would be great if some more settings will be added to getConfigAllowContext for the image field that can be used in template context via a Hook. This type of hook cannot be used to change fe. minWidth: $wire->addHookMethod('FieldtypeImage::getConfigAllowContext', function (HookEvent $e) { $allowables = ['minWidth', 'minHeight', 'noLang', 'clientQuality']; $e->return = array_merge($e->return, $allowables); }); In my case I would need the minWidth setting to be configurable in the image field in template context. I need a very large width for my slider images and a medium width for my article images. So slider images must be at least 1600px in width and article images at least 800px in width. For now I have to use advanced settings at image fields to achive this, but it would be great if this could be achived via a hook too, but it seems that this is not possible for the moment. Some other settings that could be useful are 'minWidth', 'minHeight', 'noLang', 'clientQuality'. Thanks Advanced settings by changing "$config->advanced = true;" works great in this case, so no need for adjustments.
-
Add additonal settings to image field in template context
Juergen replied to Juergen's topic in API & Templates
Thanks @Zeka I know about this and the Hook a few post above works, but only for specific settings. Taking a closer look at "getConfigAllowContext" shows that the settings I want to include are not defined as configurable in getConfigAllowContext. So for the moment it is not possible to add those settings in template context. Maybe it will be added in the future. I will write a request. -
Add additonal settings to image field in template context
Juergen replied to Juergen's topic in API & Templates
These are the only settings that I found that may work: $allowables = ['maxFiles', 'defaultValuePage', 'outputFormat', 'extensions', 'outputString', 'useTags', 'tagsList']; But what I need is to add "minWidth" at least, because I have very large images for a slider too. Therefore I need to adjust this setting. Otherwise I have to create a new image field for the slider images. -
Add additonal settings to image field in template context
Juergen replied to Juergen's topic in API & Templates
No this is correct in this case (take a look at https://abdus.co/blog/doing-more-with-fewer-fields-in-processwire/), but it seems that the settings I want to include are not supported in this case. This example from Abdus blog works: $this->addHookMethod('FieldtypeFile::getConfigAllowContext', function (HookEvent $e) { $allowables = ['maxFiles', 'defaultValuePage', 'outputFormat']; $e->return = array_merge($e->return, $allowables); }); In this case it doesnt matter if you use "FieldtypeImage" or "FieldtypeFile" - both work. The settings "maxFiles, defaultValuePage and outputFormat" work, but "minWidth, minHeight" and so on not. -
Hello, I am trying to add additional settings to an image field depending on template context with this piece of code inside my ready.php: //Image field $wire->addHookMethod('FieldtypeImage::getConfigAllowContext', function (HookEvent $e) { $allowables = ['minWidth', 'minHeight', 'noLang', 'clientQuality']; $e->return = array_merge($e->return, $allowables); }); Unfortunately the settings will not be displayed if I am inside the template fields settings page. Can someone help me out what is missing in this case? Thanks
-
I often use this library with composer: https://github.com/oscarotero/social-links Can show total of shares too! Design can be made with CSS individually.
- 9 replies
-
- 1
-
-
- website
- share buttons
-
(and 1 more)
Tagged with:
-
- 30 replies
-
- antispiders
- anticrawler
-
(and 2 more)
Tagged with:
-
This link under the download section leads to this Processwire page and not to Github because the href value is empty.
- 30 replies
-
- 2
-
-
- antispiders
- anticrawler
-
(and 2 more)
Tagged with:
-
The cropping works now also fine in my case, the only difference is in outputting the coordinates. If it is an image array you can use $image->focus() but if your image is not in array you have to use $image->focus -> without brackets I was a little bit confused for the first time, because I have used a square crop and therefore the crop focus seems to be in center instead of the coordinates. So I wanted to check if the focus coordinates are still there. Therefore I have needed to output the coordinates.
-
Ok I found the cause. There was a wrong setting in my image field. You have to set it to output an array of elements instead of a single element. My image field only allows 1 image so I set it to auto. This caused the behavior.