Jump to content

aagd

Members
  • Posts

    5
  • Joined

  • Last visited

Contact Methods

  • Website URL
    https://aagd.de

Profile Information

  • Gender
    Male
  • Location
    Munich, Germany

Recent Profile Visitors

1,121 profile views

aagd's Achievements

Jr. Member

Jr. Member (3/6)

2

Reputation

  1. Thanks, very cool idea. The str_replace() isn't even necessary, if you use basename($ext = false). // Create $image->alt method wire()->addHookProperty('Pageimage::alt', function(HookEvent $event) { /* @var $image Pageimage */ $image = $event->object; $event->return = $image->description ?: $image->basename($ext = false); }); https://processwire.com/api/ref/pagefile/basename/
  2. Hi, I'm trying to figure out if there is better a way to get a file basename without extension in Twig. In PHP I can use: $page->image->basename($ext = false) The only way I got it working in Twig seems a bit ugly: {{ page.image.basename | replace({("." ~ page.image.ext):""}) }}
  3. Is there any way of keeping HTML comments in content rendered via Markup Regions? Per default all comments seem to get filtered out (Why this?). There is a forum thread touching this topic but it doesn't answer how to get the comments back. I found in 'wire/core/WireMarkupRegions.php' there seems to be an option "exact" with is explained as: but I'm not sure if that's what I need. At least changing the default value in wire, doesn't seem to make any difference. I also found that comments starting with a hash symbol will be kept intact, like <!--#Test --> but those are actually intended as Markup Region Hints so it might affect performance to use them as regular comments!?
  4. I have the same problem, trying to get a site working with an optional SSL Proxy. The site should work with and without the proxy. I think the problem is that all paths in PW are relative, so they think the SSL Proxy is the root, and all paths miss out the actual domain then. I was experimenting with prepending all URLs in my templates with something like `/my-domain.com` in case a HTTP_X_FORWARDED_HOST is set (that's the proxy). This works well with all public parts of the site (= my templates), but not for the admin parts, which are actually the only reason the proxy would make sense. I'm looking for a way to 'repair' the admin paths like i did with my other paths for pages and assets, but have no clue how to manipulate them. Any hints welcome! Thanks, AA
  5. *** post removed by author, problem was already solved above ***
×
×
  • Create New...