Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define array keys for use in templates #361

Open
Fraenkiman opened this issue Apr 4, 2024 · 0 comments
Open

Define array keys for use in templates #361

Fraenkiman opened this issue Apr 4, 2024 · 0 comments

Comments

@Fraenkiman
Copy link
Collaborator

Fraenkiman commented Apr 4, 2024

To display certain outputs only in static pages or entries or in categories, the following array keys must be defined so that no PHP warning is issued:

Undefined array key "entry"
Undefined array key "cat"
Undefined array key "category"
Undefined array key "m"
Undefined array key "y"
Undefined array key "page"
Undefined array key "paged"
Undefined array key "comments"

Steps towards reproducibility:

Include the following queries in the header.tpl template:

				{if $flatpress.params.entry}
					{if $flatpress.params.entry}
					:: <p>Output</p>
				{/if}
					{else}
					{if $flatpress.params.cat}
						:: <p>Output</p>
					{/if}
					{if $flatpress.params.y}
						:: <p>Output</p>
						{if $flatpress.params.m}
							<p>Output</p>
						{/if}
						20{$flatpress.params.y}
					{/if}
				{/if}

function index_staticpage($page, $explicit_req, &$params, &$module) {

function index_showposts(&$params, &$module) {

@Fraenkiman Fraenkiman added this to the FlatPress 1.3.1 milestone Apr 4, 2024
@azett azett modified the milestones: FlatPress 1.3.1, FlatPress 1.4 Apr 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants