Jump to content

How to found the files associated with page template?


Jyoti Rani

Recommended Posts

20 hours ago, teraßyte said:

Not really sure what you're asking here. Could you clarify? With an example maybe.

In version 3.6

Under Pages, i can create new pages using html tag and php tags.

 

In version 4.7

When i am trying to add content for a page in PHP tag (<?php ). It starts throeing error 

 

ParseError: syntax error, unexpected string content "", expecting "-" or identifier or variable or number in system/Theme/Theme.php(4628) : eval()'d code:17
Stack trace:
applications/cms/sources/Pages/Page.php(1278): IPS\_Theme::runProcessFunction('\tfunction conte...', 'content_pages_9')
#1/applications/cms/sources/Pages/Page.php(2308): IPS\cms\Pages\_Page->getHtmlContent()
#2 /applications/cms/modules/front/pages/page.php(116): IPS\cms\Pages\_Page->output()
#3 /applications/cms/modules/front/pages/page.php(43): IPS\cms\modules\front\pages\_page->view()
#4/system/Dispatcher/Controller.php(118): IPS\cms\modules\front\pages\_page->manage()
#5/applications/cms/modules/front/pages/page.php(33): IPS\Dispatcher\_Controller->execute()
#6/system/Dispatcher/Dispatcher.php(153): IPS\cms\modules\front\pages\_page->execute()
#7 /index.php(13): IPS\_Dispatcher->run()
#8 {main}

2 minutes ago, Jyoti Rani said:

In version 3.6

Under Pages, i can create new pages using html tag and php tags.

 

In version 4.7

When i am trying to add content for a page in PHP tag (<?php ). It starts throeing error 

 

ParseError: syntax error, unexpected string content "", expecting "-" or identifier or variable or number in system/Theme/Theme.php(4628) : eval()'d code:17
Stack trace:
applications/cms/sources/Pages/Page.php(1278): IPS\_Theme::runProcessFunction('\tfunction conte...', 'content_pages_9')
#1/applications/cms/sources/Pages/Page.php(2308): IPS\cms\Pages\_Page->getHtmlContent()
#2 /applications/cms/modules/front/pages/page.php(116): IPS\cms\Pages\_Page->output()
#3 /applications/cms/modules/front/pages/page.php(43): IPS\cms\modules\front\pages\_page->view()
#4/system/Dispatcher/Controller.php(118): IPS\cms\modules\front\pages\_page->manage()
#5/applications/cms/modules/front/pages/page.php(33): IPS\Dispatcher\_Controller->execute()
#6/system/Dispatcher/Dispatcher.php(153): IPS\cms\modules\front\pages\_page->execute()
#7 /index.php(13): IPS\_Dispatcher->run()
#8 {main}

in Theme.php line of code are

            if( eval( $function ) === FALSE )
            {
                /* Throw exception for PHP 5 */
                throw new \InvalidArgumentException;
            }

Link to comment
Share on other sites

18 minutes ago, Jyoti Rani said:

Could contain: File, Page, Text, Webpagegetting the attached error. when i am adding below code in the block code require_once("xx/xx/xx/front_constants.php");

 

 

You would need to ensure you are using the correct location and that the file is readable there.

13 minutes ago, Jyoti Rani said:

Can i call functions from another files in the block file?

Im not sure what you mean here, as this appears to be essentially the same question

Link to comment
Share on other sites

28 minutes ago, Marc Stridgen said:

You would need to ensure you are using the correct location and that the file is readable there.

Im not sure what you mean here, as this appears to be essentially the same question

Issue is this when i m saving in admin section its parsing the content and loading the next line of code. Because the files are on the same location. But when i go to the frontend of the site to view the page

The url of the browser gets changed and its not able to find the file.

Could contain: Page, Text, File

 

Link to comment
Share on other sites

If your front_constants.php file is inside the admin directory (CP_DIRECTORY) you can use this:

require_once( \IPS\ROOT_PATH . '/' . \IPS\CP_DIRECTORY . '/front_constants.php' );

Instead, if it is in the root folder, where conf_global.php is located, use this:

require_once( \IPS\ROOT_PATH . '/front_constants.php' );

 

Edited by teraßyte
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...