Developing (v7+)

8.4.2 How to catch Doctrine exception in single page controller

A single page controller's [code] public function validate($args) [/code] catches php post errors. How can I catch DB exceptions thrown by Doctrine? For example I have a unique key: [code] /** * @ORM\Column(type="string",unique=true) …

JQuery Ajax add data into php session

How to add javascript data into php session $.ajax({ type: 'POST', url: '/elements/s_session.php ?>', data: {'value': out} }) .done(function(data){ alert(data); …

Wired Theme-CSS-Caching behaviour

I did some changes in the CSS files of some Blocks. (copied it to application folder first) Testimonial is one of it. Everything is showing up fine. After about a day, the old style is showing up. Clearing Cache is fixing it again for an day. Disabling th…

Filtering by Multiple Topics

Having scoured the Forum for pointers on how to best approach multiple filters it seems this is not something which is easily resolvable or likely to be added in the near future. I tried creating a CustomPageList class to extend the PageList functional…

URL to file properties in file manager

Hi all, I'm creating an email output to notify users regarding a file of their ownership. Ideally in this email, I'd be able to provide a direct link to said file in Concrete's file manager - either just the folder that it's in, or with the properties …

Create page template with preselected blocks programmatically

New to Concrete 5, and have a question. I want to create a new page type linked to a specific page template that has the blocks pulled in by default. I can see how to do this via the interface (https://documentation.concrete5.org/tutorials/how-to-recre…

8.4.2 How to set 24 hour format for datetime picker?

I use a datetime picker as [code] $dt = date('Y-m-d H:i:s', strtotime('tomorrow 09:00:00')); echo $app->make('helper/form/date_time')->datetime('pickup_dt', $dt, false, true, null, 1800, array()); [/code] It shows a 24 h format in Russian locale but …

8.4.2 How to get all locales with locale root paths?

How do I get all locales and their respective root paths? e.g. http://site.com/ http://site.com/ru/ I tried [code] use \Concrete\Core\Entity\Site\Site as Site; $site = new Site(); $this->set('locales', $site->getLocales()); [/code] but it th…

Programmatically remove guest permissions for file

Hi all, I'm running an event which should remove guest users' viewing permissions to the specified file ($f). The below code, when the event is run, is removing guest view permissions from files globally, not just for the file passed in. [code] $p…

Filter Posts