Page 1 of 1
Header Links
Posted: Thu Aug 11, 2022 6:33 pm
by Kofod95
This is just a header module that allows you to select infoPages to be shown as links in the header. There is already a supporters code that does something similar, but this one is controlled by the module-configuration instead of a language-file.
I hope it will be useful for some!
//Daniel
Re: Header Links
Posted: Thu Aug 11, 2022 7:57 pm
by Omar_one
Hi
@Kofod95 ,
after installing the module got this error when I trying to edit ( change the module-configuration)
Code: Select all
Parse error : syntax error, unexpected ';', expecting ']' in
C:\xampp\htdocs\text\admin\includes\actions\modules\infoboxes\edit.php(20) : eval()'d code
on line 1
Re: Header Links
Posted: Thu Aug 11, 2022 9:29 pm
by ecartz
To get a better error message, you could try changing (in core)
line 20 of includes\actions\modules\infoboxes\edit.php to
Code: Select all
try {
$eval_code = '$keys .= ' . $value['set_function'] . "'" . addslashes($value['value']) . "', '" . $key . "');";
eval($eval_code);
} catch (ParseError $e) {
error_log("Could not parse `$eval_code` for [$key]");
throw $e;
}
This also would move the line of the error to either 22 or 25.
Re: Header Links
Posted: Fri Aug 12, 2022 10:17 am
by Kofod95
Thank you,
Try removing the module (uninstall) and change the ; in line 36 of includes/modules/content/header/cm_heaer_links.php to a ,
I've updated the package in the first post as well.
//Daniel
Re: Header Links
Posted: Fri Aug 12, 2022 10:42 am
by Omar_one
ecartz wrote: ↑Thu Aug 11, 2022 9:29 pm
To get a better error message, you could try changing (in core)
line 20 of includes\actions\modules\infoboxes\edit.php to
Code: Select all
try {
$eval_code = '$keys .= ' . $value['set_function'] . "'" . addslashes($value['value']) . "', '" . $key . "');"
eval($eval_code);
} catch (ParseError $e) {
error_log("Could not parse `$eval_code` for [$key]");
throw $e;
}
This also would move the line of the error to either 22 or 25.
now there error
Code: Select all
Parse error
: syntax error, unexpected 'eval' (T_EVAL) in
C:\xampp\htdocs\test\admin\includes\actions\modules\infoboxes\edit.php
on line
22
Re: Header Links
Posted: Fri Aug 12, 2022 10:54 am
by Omar_one
Kofod95 wrote: ↑Fri Aug 12, 2022 10:17 am
Thank you,
Try removing the module (uninstall) and change the ; in line 36 of includes/modules/content/header/cm_heaer_links.php to a ,
I've updated the package in the first post as well.
//Daniel
thats fix the issue.
if I create info page after install the module it's not shown under Pages to link to(module-configuration) , need to uninstall the module and install it again then it will show the new info page
Br
Omar
Re: Header Links
Posted: Wed Aug 24, 2022 7:27 pm
by Kofod95
Omar_one wrote: ↑Fri Aug 12, 2022 10:54 am
if I create info page after install the module it's not shown under Pages to link to(module-configuration) , need to uninstall the module and install it again then it will show the new info page
Update where new pages show up automatically.
I took a more in-depth look at core and found some help. This also helped me cut down on unnecessary code. Core is an amazing place to look around!
//Daniel