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

HTML Block on Static Pages #50

Open
lfe011969 opened this issue Feb 16, 2021 · 2 comments
Open

HTML Block on Static Pages #50

lfe011969 opened this issue Feb 16, 2021 · 2 comments

Comments

@lfe011969
Copy link

lfe011969 commented Feb 16, 2021

Per the following verbiage on the Static Pages plugin page (https://moodle.org/plugins/pluginversion.php?id=11257), it should be possible to show different HTML blocks on different static pages:

Add blocks to static pages
The local_staticpage plugin was not intended to show blocks on the static pages. However, it is possible. You have to enable page editing somewhere else in Moodle (on your MyMoodle page or on a course page, for example) and go to your static page. Now you see the standard "Add block" menu and can add blocks to the static page. Additionally, if you click on the block's gear icon, you can control if the block is shown only on the static page the block was added to or on all static pages.

However, whenever I add an HTML block to an individual page, it shows up on all static pages. The options for selecting where the block is displayed are:

  1. local-staticpage-view
  2. local-staticpage-view*
  3. local-staticpage-*
  4. local-*
  5. Any page

I currently have each of the HTML blocks set to option 1 (local-staticpage-view) but it doesn't seem to matter as I've tried each of the options containing the phrase 'staticpage' and all HTML blocks show up for every static page. Hoping this is not something to do with our Theme since we don't want to change that.

If it is not a theme-related issue, then I would like to request this functionality be implemented so that individual static pages can have different HTML (and possibly other) blocks.

For reference, the static pages for our site are open to the public and can be viewed here:
https://apprenticemoodle.com/local/staticpage/view.php?page=Youth-Builders
https://apprenticemoodle.com/local/staticpage/view.php?page=book-info

The HTML block at the top of each page should only be shown on the first link's page while the second HTML block should be shown only on the second link's page.

@christianwolters
Copy link
Member

Hi @lfe011969,

thank you for raising this issue and your examples.

After a short investigation this may due to the implicit setting of the pagetype by the Moodle Page API.

First idea:
I may be able to provide a fix by setting an explizit page type, suffixing the exisiting one with the document name.
However, this would break if the document title changes. Furthermore if deleting a document without deleting the blocks first, the blocks from this static page would be orphaned in the database.

I'll be getting back to this.

Cheers
Christian

@dolivervl
Copy link

Any solutions ?

@abias abias mentioned this issue Dec 8, 2021
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

3 participants