kkalgidim Posted July 16, 2020 Share Posted July 16, 2020 echo title; Output -> Murat Övünç Konseri After i save page title become like this on admin panel -> Murat Övünç Konseri Here the code i save page $p = new Page(); // create a new page $p->template = 'home'; // choose template $p->parent = wire('pages')->get('/posts/'); // choose parent page $p->name = $wire->sanitizer->text($baslik[1]); $p->title = $wire->sanitizer->text($baslik[1]); $p->save(); // save the page Its multilanguage profile template ı attached the admin panel output what should i do? Link to comment Share on other sites More sharing options...
Robin S Posted July 16, 2020 Share Posted July 16, 2020 5 hours ago, kkalgidim said: After i save page title become like this on admin panel -> Murat Övünç Konseri This means that the value you are saving to the title field has had its special characters converted to HTML entities. You don't want this because the PW admin automatically applies htmlspecialchars() to the title and so the entities are being double-encoded. So if $baslik[1] is being entity encoded somewhere in your code then simply don't do this step, or if you are getting the value from somewhere where the value is already entity encoded then you can use html_entity_decode() or instruct $sanitizer->text to convert entities: $p->title = $wire->sanitizer->text($baslik[1], ['convertEntities' => true]); 5 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now