Using custom RecordDataFormatter templates

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Using custom RecordDataFormatter templates

Leila Gonzales

Hi all,


We just recently upgraded to VuFind 4.0 and are trying to migrate our old theme templates into the new format using the RecordDataFormatter per the tips on the Wiki page (https://vufind.org/wiki/development:architecture:record_data_formatter), and are running into an issue where the $formatter = $this->recordDataFormatter(); line in core.phtml is returning an internal server error code.

 

Right now I’ve just copied over the following files and have not yet started implementing any custom data-NAME.phtml templates. Here’s what I’ve done so far:

1.       Copy RecordDataFormatterFactory.php into my custom module’s View/Helper/Root directory.

a.       Set namespace to customModule\View\Helper\Root;

b.      Add class extends \VuFind\View\Helper\Root\RecordDataFormatterFactory

c.       Remove all methods except for public function getDefaultCoreSpecs ()

d.      Change  $spec = new  RecordDataFormatter\SpecBuilder(); to  $spec = new \VuFind\View\Helper\Root\RecordDataFormatter\SpecBuilder();

 

2.       Register the RecordDataFormatterFactory in my custom theme’s theme.config.php file (and this file also extends bootstrap3 and root)

    'helpers' => array(

        'factories' => array(

            'recorddataformatter' => 'customModule\View\Helper\Root\RecordDataFormatterFactory',

 

3.       Copy over the core.phtml from bootstrap3/templates/RecordDriver/SolrDefault/ to my custom theme directory.

 

Is there something else I should be doing to set up the configuration properly?

 

Thanks for your help,

Leila


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Vufind-tech mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-tech
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using custom RecordDataFormatter templates

Demian Katz

It would be helpful to know what the internal server error actually is – maybe it’s just a minor parse error caused by a typo somewhere. Are you seeing any helpful messages in your Apache error log? That’s usually the place to look for the cause of 500 errors.

 

- Demian

 

From: Leila Gonzales [mailto:[hidden email]]
Sent: Tuesday, July 25, 2017 1:49 PM
To: vufind-tech
Subject: [VuFind-Tech] Using custom RecordDataFormatter templates

 

Hi all,


We just recently upgraded to VuFind 4.0 and are trying to migrate our old theme templates into the new format using the RecordDataFormatter per the tips on the Wiki page (https://vufind.org/wiki/development:architecture:record_data_formatter), and are running into an issue where the $formatter = $this->recordDataFormatter(); line in core.phtml is returning an internal server error code.

 

Right now I’ve just copied over the following files and have not yet started implementing any custom data-NAME.phtml templates. Here’s what I’ve done so far:

1.       Copy RecordDataFormatterFactory.php into my custom module’s View/Helper/Root directory.

Set namespace to customModule\View\Helper\Root;

Add class extends \VuFind\View\Helper\Root\RecordDataFormatterFactory

Remove all methods except for public function getDefaultCoreSpecs ()

Change  $spec = new  RecordDataFormatter\SpecBuilder(); to  $spec = new \VuFind\View\Helper\Root\RecordDataFormatter\SpecBuilder();

 

2.       Register the RecordDataFormatterFactory in my custom theme’s theme.config.php file (and this file also extends bootstrap3 and root)

    'helpers' => array(

        'factories' => array(

            'recorddataformatter' => 'customModule\View\Helper\Root\RecordDataFormatterFactory',

 

3.       Copy over the core.phtml from bootstrap3/templates/RecordDriver/SolrDefault/ to my custom theme directory.

 

Is there something else I should be doing to set up the configuration properly?

 

Thanks for your help,

Leila


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Vufind-tech mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-tech
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using custom RecordDataFormatter templates

Leila Gonzales

Thanks Demian.  The Apache error log doesn’t show anything. When I turn on the error logging in the httpd.vufind.config file, it shows a syntax error, unexpected ‘$spec’ (T_VARIABLE);

 

I’ve tried changing  $spec = new \VuFind\View\Helper\Root\RecordDataFormatter\SpecBuilder(); back to  $spec = new RecordDataFormatter\SpecBuilder(); and am getting the same error. Any ideas?

 

Thanks,
Leila

 

From: Demian Katz [mailto:[hidden email]]
Sent: Tuesday, July 25, 2017 11:00 AM
To: Leila Gonzales; vufind-tech
Subject: RE: [VuFind-Tech] Using custom RecordDataFormatter templates

 

It would be helpful to know what the internal server error actually is – maybe it’s just a minor parse error caused by a typo somewhere. Are you seeing any helpful messages in your Apache error log? That’s usually the place to look for the cause of 500 errors.

 

- Demian

 

From: Leila Gonzales [[hidden email]]
Sent: Tuesday, July 25, 2017 1:49 PM
To: vufind-tech
Subject: [VuFind-Tech] Using custom RecordDataFormatter templates

 

Hi all,


We just recently upgraded to VuFind 4.0 and are trying to migrate our old theme templates into the new format using the RecordDataFormatter per the tips on the Wiki page (https://vufind.org/wiki/development:architecture:record_data_formatter), and are running into an issue where the $formatter = $this->recordDataFormatter(); line in core.phtml is returning an internal server error code.

 

Right now I’ve just copied over the following files and have not yet started implementing any custom data-NAME.phtml templates. Here’s what I’ve done so far:

1.       Copy RecordDataFormatterFactory.php into my custom module’s View/Helper/Root directory.

Set namespace to customModule\View\Helper\Root;

Add class extends \VuFind\View\Helper\Root\RecordDataFormatterFactory

Remove all methods except for public function getDefaultCoreSpecs ()

Change  $spec = new  RecordDataFormatter\SpecBuilder(); to  $spec = new \VuFind\View\Helper\Root\RecordDataFormatter\SpecBuilder();

 

2.       Register the RecordDataFormatterFactory in my custom theme’s theme.config.php file (and this file also extends bootstrap3 and root)

    'helpers' => array(

        'factories' => array(

            'recorddataformatter' => 'customModule\View\Helper\Root\RecordDataFormatterFactory',

 

3.       Copy over the core.phtml from bootstrap3/templates/RecordDriver/SolrDefault/ to my custom theme directory.

 

Is there something else I should be doing to set up the configuration properly?

 

Thanks for your help,

Leila


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Vufind-tech mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-tech
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using custom RecordDataFormatter templates

Demian Katz

“Unexpected ‘$spec’” probably indicates that something is wrong above that code – like a missing semi-colon, missing/mismatched brace, etc. Basically the parser is expecting something specific, and it’s finding your $spec declaration instead. Double-check the surrounding code, and if you still don’t see anything obviously wrong, feel free to share the whole file with me.

 

- Demian

 

From: Leila Gonzales [mailto:[hidden email]]
Sent: Tuesday, July 25, 2017 2:31 PM
To: Demian Katz; vufind-tech
Subject: RE: [VuFind-Tech] Using custom RecordDataFormatter templates

 

Thanks Demian.  The Apache error log doesn’t show anything. When I turn on the error logging in the httpd.vufind.config file, it shows a syntax error, unexpected ‘$spec’ (T_VARIABLE);

 

I’ve tried changing  $spec = new \VuFind\View\Helper\Root\RecordDataFormatter\SpecBuilder(); back to  $spec = new RecordDataFormatter\SpecBuilder(); and am getting the same error. Any ideas?

 

Thanks,
Leila

 

From: Demian Katz [mailto:[hidden email]]
Sent: Tuesday, July 25, 2017 11:00 AM
To: Leila Gonzales; vufind-tech
Subject: RE: [VuFind-Tech] Using custom RecordDataFormatter templates

 

It would be helpful to know what the internal server error actually is – maybe it’s just a minor parse error caused by a typo somewhere. Are you seeing any helpful messages in your Apache error log? That’s usually the place to look for the cause of 500 errors.

 

- Demian

 

From: Leila Gonzales [[hidden email]]
Sent: Tuesday, July 25, 2017 1:49 PM
To: vufind-tech
Subject: [VuFind-Tech] Using custom RecordDataFormatter templates

 

Hi all,


We just recently upgraded to VuFind 4.0 and are trying to migrate our old theme templates into the new format using the RecordDataFormatter per the tips on the Wiki page (https://vufind.org/wiki/development:architecture:record_data_formatter), and are running into an issue where the $formatter = $this->recordDataFormatter(); line in core.phtml is returning an internal server error code.

 

Right now I’ve just copied over the following files and have not yet started implementing any custom data-NAME.phtml templates. Here’s what I’ve done so far:

1.       Copy RecordDataFormatterFactory.php into my custom module’s View/Helper/Root directory.

Set namespace to customModule\View\Helper\Root;

Add class extends \VuFind\View\Helper\Root\RecordDataFormatterFactory

Remove all methods except for public function getDefaultCoreSpecs ()

Change  $spec = new  RecordDataFormatter\SpecBuilder(); to  $spec = new \VuFind\View\Helper\Root\RecordDataFormatter\SpecBuilder();

 

2.       Register the RecordDataFormatterFactory in my custom theme’s theme.config.php file (and this file also extends bootstrap3 and root)

    'helpers' => array(

        'factories' => array(

            'recorddataformatter' => 'customModule\View\Helper\Root\RecordDataFormatterFactory',

 

3.       Copy over the core.phtml from bootstrap3/templates/RecordDriver/SolrDefault/ to my custom theme directory.

 

Is there something else I should be doing to set up the configuration properly?

 

Thanks for your help,

Leila


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Vufind-tech mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-tech
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using custom RecordDataFormatter templates

Leila Gonzales

Many thanks Demian. I re-copied over the RecordDataFormatterFactory.php file into my custom module’s directory, re-did my modifications, and it’s working perfectly now.

 

-Leila

 

From: Demian Katz [mailto:[hidden email]]
Sent: Tuesday, July 25, 2017 11:38 AM
To: Leila Gonzales; vufind-tech
Subject: RE: [VuFind-Tech] Using custom RecordDataFormatter templates

 

“Unexpected ‘$spec’” probably indicates that something is wrong above that code – like a missing semi-colon, missing/mismatched brace, etc. Basically the parser is expecting something specific, and it’s finding your $spec declaration instead. Double-check the surrounding code, and if you still don’t see anything obviously wrong, feel free to share the whole file with me.

 

- Demian

 

From: Leila Gonzales [[hidden email]]
Sent: Tuesday, July 25, 2017 2:31 PM
To: Demian Katz; vufind-tech
Subject: RE: [VuFind-Tech] Using custom RecordDataFormatter templates

 

Thanks Demian.  The Apache error log doesn’t show anything. When I turn on the error logging in the httpd.vufind.config file, it shows a syntax error, unexpected ‘$spec’ (T_VARIABLE);

 

I’ve tried changing  $spec = new \VuFind\View\Helper\Root\RecordDataFormatter\SpecBuilder(); back to  $spec = new RecordDataFormatter\SpecBuilder(); and am getting the same error. Any ideas?

 

Thanks,
Leila

 

From: Demian Katz [mailto:[hidden email]]
Sent: Tuesday, July 25, 2017 11:00 AM
To: Leila Gonzales; vufind-tech
Subject: RE: [VuFind-Tech] Using custom RecordDataFormatter templates

 

It would be helpful to know what the internal server error actually is – maybe it’s just a minor parse error caused by a typo somewhere. Are you seeing any helpful messages in your Apache error log? That’s usually the place to look for the cause of 500 errors.

 

- Demian

 

From: Leila Gonzales [[hidden email]]
Sent: Tuesday, July 25, 2017 1:49 PM
To: vufind-tech
Subject: [VuFind-Tech] Using custom RecordDataFormatter templates

 

Hi all,


We just recently upgraded to VuFind 4.0 and are trying to migrate our old theme templates into the new format using the RecordDataFormatter per the tips on the Wiki page (https://vufind.org/wiki/development:architecture:record_data_formatter), and are running into an issue where the $formatter = $this->recordDataFormatter(); line in core.phtml is returning an internal server error code.

 

Right now I’ve just copied over the following files and have not yet started implementing any custom data-NAME.phtml templates. Here’s what I’ve done so far:

1.       Copy RecordDataFormatterFactory.php into my custom module’s View/Helper/Root directory.

Set namespace to customModule\View\Helper\Root;

Add class extends \VuFind\View\Helper\Root\RecordDataFormatterFactory

Remove all methods except for public function getDefaultCoreSpecs ()

Change  $spec = new  RecordDataFormatter\SpecBuilder(); to  $spec = new \VuFind\View\Helper\Root\RecordDataFormatter\SpecBuilder();

 

2.       Register the RecordDataFormatterFactory in my custom theme’s theme.config.php file (and this file also extends bootstrap3 and root)

    'helpers' => array(

        'factories' => array(

            'recorddataformatter' => 'customModule\View\Helper\Root\RecordDataFormatterFactory',

 

3.       Copy over the core.phtml from bootstrap3/templates/RecordDriver/SolrDefault/ to my custom theme directory.

 

Is there something else I should be doing to set up the configuration properly?

 

Thanks for your help,

Leila


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Vufind-tech mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vufind-tech
Loading...