Warning: This page has not been updated in over over a year and may be outdated or deprecated.
videos:managing_static_content
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
videos:managing_static_content [2021/11/10 15:34] – [Transcript] demiankatz | videos:managing_static_content [2023/03/28 16:02] (current) – crhallberg | ||
---|---|---|---|
Line 14: | Line 14: | ||
// This is a machine-generated transcript and will be corrected as time permits. // | // This is a machine-generated transcript and will be corrected as time permits. // | ||
- | | + | Hello, |
- | viewfind | + | |
- | managing static content | + | When I say static content, I'm just referring to the ability to create custom |
- | when i say static content | + | |
- | referring to the ability to create | + | When you get VuFind |
- | custom | + | |
- | within your viewfind | + | Let me quickly show you where this lives in the default theme, and then we'll move forward to creating some content of our own. So if I go into VuFind' |
- | or to embed that type of information | + | |
- | within some of viewfind's existing | + | So with that background out of the way, let me do some quick demos, and I'll start by showing you how to create a Markdown-based content page in your VuFind |
- | displays | + | |
- | viewfinder | + | Now that we're on our custom theme, creating a new content page is as simple as going into our theme folder, so under themes/tutorial/templates/, we need to create a new folder called content, since this is the first content page we're creating, and in this content folder, we can just create a new file. So as I said earlier, the file name will correspond with the URL where the content will be displayed, so I'm going to call this Markdown-demo, but the extension of the file will tell if you find how to render the content. So if I were to end this in .php, it would render as a standard |
- | a content management system and so i | + | |
- | certainly wouldn' | + | So I'm saving this file of Markdown. Now if I return to my browser, and I go to /content/Markdown-demo, as part of my VuFind URL, there is my Markdown, |
- | build your entire web presence but | + | |
- | sometimes it's useful to be able to | + | I also mentioned earlier that the content display system supports internationalization. So if you're if you find instance supports multiple languages, you can create multiple versions of your static content, and VuFind |
- | place a page of custom content into the | + | |
- | context of viewfind | + | So now, if I go back to my browser, I need to go to the right browser. If I go back to my browser, and I edit my URL so that it is /content/i18n after the page VuFind URL, I see my, this is an English |
- | some tools to enable you to do this and | + | |
- | to also take advantage of ufind's | + | I should also make a quick note on how the default behavior works for these templates. If you have a number of languages, but you don't have templates for all of them. So for example, if I switch this to German, |
- | internationalization support along the | + | |
- | way | + | In any case, that shows you all the capabilities for creating static pages in Markdown |
- | uh when you get viewfind | + | |
- | it ships with a couple of examples of | + | First of all, let's go into the core VuFind |
- | static content which are really just | + | |
- | meant to be overridden | + | I'm going to copy this whole route. And then I'm going to go into my local tutorial module and into the configuration and the module config. So in here, we have a custom route that we set up in a past video. And I'm just going to paste in that content route right above it. And the formatting is a little ugly here, but I'm not going to worry about that right now, just bear with me. So first of all, we want to give every route a unique name because we don't want to override the existing content page route. We want all of our content to keep working. And if I didn't change this, this content page route would override the core version. So instead, I'm just going to call this content demo. And then I'm going to go to my options and I'm going to replace this content |
- | as you customize the system | + | |
- | include the ask a librarian | + | So let me show you. If I now go here and I just put Markdown |
- | pages | + | |
- | which show in the footer and just | + | But what about incorporating this type of content into an existing page? If you find has something called content blocks, which are currently used on the various search home pages to drop in interesting information. So for example, if I just go to my search home screen, on I'm going to set this back to English |
- | contain placeholder information | + | |
- | if you click through to them | + | This is a configurable setting that you can find in searches.ini, and all of you find search |
- | so | + | |
- | creating these static content pages is | + | So I am going to demonstrate that for you right now. So first of all, because this demo instance doesn' |
- | pretty easy uh it's just a matter of | + | |
- | putting templates in a particular | + | So the template based content block follows all of the same rules and conventions as the full page templates. So you can use the language suffixes on the file names or not as you prefer. You can use PHP templates or Markdown |
- | directory within your theme | + | |
- | and then vufine | + | In any case, thanks for your time and for listening to this. I hope this makes it easier for you to share information through your VuFind |
- | let me quickly show you uh where this | + | |
- | lives in the default theme and then | + | |
- | we'll move forward to creating some | + | |
- | content of our own | + | |
- | so if i | + | |
- | go into viewfinds | + | |
- | look under bootstrap 3 | + | |
- | in the templates | + | |
- | content directory | + | |
- | you'll see that we have | + | |
- | an | + | |
- | faq.phtml | + | |
- | an asklibrary.phtml | + | |
- | and a couple of other utility templates | + | |
- | that are actually used by the content | + | |
- | display code | + | |
- | but the important thing to take away | + | |
- | here is that if you see a file that | + | |
- | starts with faq | + | |
- | and you go to your browser and add | + | |
- | content slash faq after the base url uh | + | |
- | viewfinder will display that template to | + | |
- | you providing a really easy way to | + | |
- | render custom content | + | |
- | if you also supports | + | |
- | want to create your content using uh the | + | |
- | markdown | + | |
- | templates | + | |
- | which may be more convenient if you're | + | |
- | working with a content development team | + | |
- | that's less comfortable with coding | + | |
- | because the markdown | + | |
- | used | + | |
- | so with that background out of the way | + | |
- | let me do some quick demos and i'll | + | |
- | start by showing you how to create a | + | |
- | markdown | + | |
- | viewfind | + | |
- | right now we're looking at viewfind's | + | |
- | core boot print three theme | + | |
- | so let's switch to our custom tutorial | + | |
- | template so we're in a better position | + | |
- | to customize some things | + | |
- | i'm just going to switch to my local | + | |
- | config viewfind config.ini file | + | |
- | and i'm going to comment out the | + | |
- | bootprint 3 setting to activate my | + | |
- | tutorial setting | + | |
- | now if i go back to my browser and | + | |
- | refresh | + | |
- | we get to see | + | |
- | the custom tutorial theme that we've | + | |
- | been using in some of these videos | + | |
- | now that we're on our custom theme | + | |
- | creating a new uh content page is as | + | |
- | simple as going into our theme folder so | + | |
- | under themes tutorial | + | |
- | templates | + | |
- | uh we need to create a new folder called | + | |
- | content | + | |
- | since this is the first content page | + | |
- | we're creating | + | |
- | uh and in this content folder | + | |
- | uh we can just create a new file | + | |
- | so as i said earlier the file name will | + | |
- | correspond with the url where the | + | |
- | content will be displayed so i'm going | + | |
- | to call this markdown | + | |
- | but the extension of the file will tell | + | |
- | if you find how to render the content | + | |
- | if i were to end this in dot p html it | + | |
- | would render as a standard | + | |
- | but of course | + | |
- | markdown | + | |
- | so i'm going to | + | |
- | name the file dot md instead | + | |
- | so now i have an empty file and i'm | + | |
- | going to put some markdown | + | |
- | i'm not going to go into any depth on | + | |
- | the markdown | + | |
- | because there are lots of tutorials and | + | |
- | cheat sheets out there | + | |
- | but it's widely used you probably run | + | |
- | across it somewhere and even if you | + | |
- | haven' | + | |
- | uh in any case i'm going to start with | + | |
- | pound my title because prefixing text | + | |
- | with the pound is how you create a | + | |
- | heading in markdown | + | |
- | and then i'm just going to put a line of | + | |
- | content | + | |
- | star | + | |
- | markdown | + | |
- | formatting | + | |
- | and i'm going to say here is a | + | |
- | bracket | + | |
- | link | + | |
- | parenthesis | + | |
- | this to the view find home page just for | + | |
- | fun | + | |
- | and that's it | + | |
- | so i'm saving this file of markdown | + | |
- | now if i return to my browser | + | |
- | and i go to content | + | |
- | part of my viewfinder url | + | |
- | there is my markdown | + | |
- | viewfind | + | |
- | also you might notice that the | + | |
- | tab in my browser actually shows my | + | |
- | title | + | |
- | the markdown | + | |
- | take top level headings and use those as | + | |
- | the page title for you | + | |
- | and if i were to click this link | + | |
- | it would take me to the viewfind | + | |
- | page so | + | |
- | it's that simple | + | |
- | down to your heart' | + | |
- | it up through | + | |
- | institution specific pages custom help | + | |
- | screens whatever you like | + | |
- | i also mentioned earlier | + | |
- | that the content display system supports | + | |
- | internationalization | + | |
- | viewfinder | + | |
- | languages | + | |
- | you can create multiple versions of your | + | |
- | static content and viewfind | + | |
- | the appropriate one based on the | + | |
- | language that's currently active | + | |
- | uh the the way you do this | + | |
- | is simply | + | |
- | language code | + | |
- | on the end of your file names so i'll do | + | |
- | a quick demo of this as well | + | |
- | i will create a new file called | + | |
- | underscore | + | |
- | en.phtml | + | |
- | so this is going to create a content | + | |
- | page called i18n you know the common | + | |
- | abbreviation for internationalization | + | |
- | uh and this is going to be the english | + | |
- | language version of that and i'm | + | |
- | indicating that with the underscore en | + | |
- | at the end of the file name | + | |
- | uh and this demo i'm just going to do | + | |
- | standard phtml templates | + | |
- | easily use markdown | + | |
- | difference | + | |
- | i'm just showing both versions for | + | |
- | demo purposes | + | |
- | so then i can say in here this is in | + | |
- | english | + | |
- | and since this wouldn' | + | |
- | exciting demo if i didn't have another | + | |
- | language as well | + | |
- | i'm going to create another file called | + | |
- | i18n underscore fr.phtml | + | |
- | for french | + | |
- | here this is not in french | + | |
- | pretend | + | |
- | i will save that | + | |
- | so now if i go back to my browser | + | |
- | i need to go to the right browser | + | |
- | uh if i go back to my browser | + | |
- | and i edit my url so that it is content | + | |
- | slash i18n | + | |
- | after the base viewfind url i see my | + | |
- | this is an english | + | |
- | then if i switch my language to french | + | |
- | this is not in french | + | |
- | it's that simple | + | |
- | i should also uh make a quick note on | + | |
- | how the default behavior works for these | + | |
- | templates | + | |
- | a number of languages | + | |
- | but you don't have templates for all of | + | |
- | them so for example if i switch this to | + | |
- | german | + | |
- | it actually says this is in english | + | |
- | the reason for that | + | |
- | is that in | + | |
- | config.ini you're able to set a default | + | |
- | language for your site | + | |
- | and if viewfind | + | |
- | template for the requested language | + | |
- | it will next search for a template in | + | |
- | the default language as a fallback | + | |
- | this example | + | |
- | english | + | |
- | configured in config.ini | + | |
- | so viewfinder | + | |
- | english | + | |
- | if there were no english | + | |
- | would next look to see if there were | + | |
- | simply an i18n.php | + | |
- | template with no language code at all it | + | |
- | would use that next | + | |
- | and only if all of those options failed | + | |
- | would it give up and throw an error | + | |
- | about content being unavailable | + | |
- | in any case that shows you all the | + | |
- | capabilities for creating static pages | + | |
- | in markdown | + | |
- | internationalization support | + | |
- | one thing that uh you might want to do | + | |
- | though | + | |
- | is give one of your content pages a | + | |
- | custom | + | |
- | uh as you notice by default all of the | + | |
- | content pages have urls with slash | + | |
- | content slash something in them | + | |
- | but | + | |
- | through the magic of the laminas | + | |
- | system it's not very difficult at all to | + | |
- | give these any url you like | + | |
- | so i'll show you that really quickly | + | |
- | first of all | + | |
- | let's go into the | + | |
- | core viewfinder | + | |
- | my view find home module | + | |
- | and i'm looking at the configuration | + | |
- | here so in my viewfind | + | |
- | to the configuration directory and | + | |
- | opening module.config.php | + | |
- | and at the top of this file | + | |
- | are all of the route definitions which | + | |
- | we've talked about in the past but one | + | |
- | of these routes | + | |
- | is called content page | + | |
- | and it is this route which does all the | + | |
- | magic of resolving content for you | + | |
- | so it's a segment based route and it | + | |
- | looks for slash content slash something | + | |
- | when it encounters a match for that | + | |
- | pattern | + | |
- | it calls the content action of the | + | |
- | content controller and passes through | + | |
- | part of the url as a parameter called | + | |
- | page | + | |
- | so this is how | + | |
- | you're able to type in a content | + | |
- | have viewfinds | + | |
- | appropriate template to display | + | |
- | but if you want to give a different | + | |
- | to a content page you can simply copy | + | |
- | this route into your local module make a | + | |
- | few small changes | + | |
- | and get the effect you want | + | |
- | so i'm going to do exactly that i'm | + | |
- | going to copy this whole route | + | |
- | and then i'm going to go into my local | + | |
- | tutorial module and into the | + | |
- | configuration | + | |
- | and the module config | + | |
- | so in here | + | |
- | we have | + | |
- | a custom route that we set up in a past | + | |
- | video | + | |
- | and i'm just going to paste in | + | |
- | that content route right above it | + | |
- | uh and the formatting is a little ugly | + | |
- | here but i'm not going to worry about | + | |
- | that right now just bear with me | + | |
- | so first of all | + | |
- | we want to give every route a unique | + | |
- | name because we don't want to override | + | |
- | the existing content page route we want | + | |
- | all of our content to keep working | + | |
- | and if i didn't change this this content | + | |
- | page route would override the core | + | |
- | version | + | |
- | so instead | + | |
- | content demo | + | |
- | uh and then | + | |
- | i'm going to go to my options and i'm | + | |
- | going to replace this content | + | |
- | page thing | + | |
- | with the url that i want to use so let's | + | |
- | say we want to show that markdown | + | |
- | at a url | + | |
- | called | + | |
- | markdown | + | |
- | i can just put that in | + | |
- | uh | + | |
- | because there' | + | |
- | anymore | + | |
- | and instead | + | |
- | and i can just hard code a page value | + | |
- | here | + | |
- | and this is going to be markdown | + | |
- | it's that simple | + | |
- | named content demo | + | |
- | it's going to look for | + | |
- | a url that just says markdown | + | |
- | and when it encounters that url it's | + | |
- | going to call the content action of the | + | |
- | content controller and it's going to | + | |
- | pass it a page parameter of markdown | + | |
- | demo | + | |
- | which is exactly the same as using the | + | |
- | other route to go to slash content slash | + | |
- | markdown | + | |
- | so let me show you if i now | + | |
- | go here and i just put mark down demo on | + | |
- | the end of my viewfinder url | + | |
- | i get to see my markdown | + | |
- | so in this way you can seamlessly | + | |
- | incorporate static content into your url | + | |
- | structure | + | |
- | as long as you're careful not to collide | + | |
- | with existing | + | |
- | so uh | + | |
- | that covers all of the standalone page | + | |
- | content | + | |
- | this type of content into an existing | + | |
- | page | + | |
- | viewfinder | + | |
- | blocks | + | |
- | which are currently used on the various | + | |
- | search home pages | + | |
- | to drop in interesting information | + | |
- | so for example | + | |
- | if i just go | + | |
- | to | + | |
- | my search home screen | + | |
- | and i'm going to set this back to | + | |
- | english | + | |
- | uh you will see | + | |
- | that we have this facet information here | + | |
- | and this is actually being dropped in as | + | |
- | a content block | + | |
- | this is a configurable setting | + | |
- | that you can find in searches.ini and | + | |
- | all of you finds search | + | |
- | content block configuration so that you | + | |
- | can put different content on each of | + | |
- | their home pages | + | |
- | let me show you | + | |
- | uh in practice here | + | |
- | so if i go to | + | |
- | view finds main config | + | |
- | directory | + | |
- | and i look at the searches.ini file | + | |
- | which controls the behavior of the main | + | |
- | default solar-based search | + | |
- | near the bottom of this file | + | |
- | there's a setting called content | + | |
- | and this is where | + | |
- | we configure the content blocks for the | + | |
- | home page | + | |
- | by default | + | |
- | two content blocks are set up one is | + | |
- | called | + | |
- | does not display anything but it will | + | |
- | check to see if your ils is offline | + | |
- | if it is it will display a warning | + | |
- | message that some functionality may be | + | |
- | unavailable | + | |
- | if you're not using an ils or you don't | + | |
- | want this feature you might consider | + | |
- | commenting this out | + | |
- | following | + | |
- | there' | + | |
- | is what creates that facet list i was | + | |
- | showing you and again if you don't like | + | |
- | that you can simply turn off this | + | |
- | setting to get rid of it | + | |
- | and you can also | + | |
- | choose from some of the other content | + | |
- | blocks that are listed in the comments | + | |
- | up here | + | |
- | or you can build your own but for today | + | |
- | what i want to show you is a content | + | |
- | block called template based | + | |
- | which allows you to drop static content | + | |
- | onto your home page | + | |
- | in much the same way as you are able to | + | |
- | create | + | |
- | the static content pages i just showed | + | |
- | you | + | |
- | so i am going to demonstrate that for | + | |
- | you right now | + | |
- | so first of all | + | |
- | because | + | |
- | this demo instance doesn' | + | |
- | searches.ini yet | + | |
- | i am going to copy | + | |
- | the | + | |
- | coresearches.ini file into my local | + | |
- | settings directory | + | |
- | to do some custom configuration | + | |
- | so i'm | + | |
- | copying from | + | |
- | viewfind | + | |
- | searches.ini into | + | |
- | local | + | |
- | config | + | |
- | and then | + | |
- | i'm going to scroll down here so i can | + | |
- | customize my content | + | |
- | so to turn this on i simply need to add | + | |
- | another content block settings so i can | + | |
- | say content bracket bracket | + | |
- | and the brackets are important because | + | |
- | this is a repeating setting | + | |
- | to be sure | + | |
- | that we don't override the setting | + | |
- | rather than adding to it | + | |
- | and i could say equals | + | |
- | template based which is the name of the | + | |
- | content block | + | |
- | colon | + | |
- | i18n | + | |
- | we just need to give | + | |
- | a template base name | + | |
- | for the content block to use | + | |
- | in this case i'm choosing i18n because | + | |
- | that allows me to be really lazy and | + | |
- | simply copy and paste the templates | + | |
- | that i created for the earlier full page | + | |
- | example | + | |
- | the only difference is what directory | + | |
- | the files go in within my theme | + | |
- | so for | + | |
- | page content | + | |
- | for content block content | + | |
- | i just need to create a different | + | |
- | directory to put my files into | + | |
- | and that directory is | + | |
- | content block with a capital | + | |
- | capital | + | |
- | and under that | + | |
- | a folder called | + | |
- | template | + | |
- | so i can now just take my two | + | |
- | i18n | + | |
- | templates | + | |
- | copy them | + | |
- | paste them into here | + | |
- | and make sure that i saved my | + | |
- | configuration properly | + | |
- | it's also worth noting | + | |
- | that the order of the content settings | + | |
- | affects the order of the display | + | |
- | set this up so that the template will | + | |
- | appear | + | |
- | above | + | |
- | the | + | |
- | facet list | + | |
- | and below any ils related messages | + | |
- | could move this line around if i wish to | + | |
- | do things differently | + | |
- | and now | + | |
- | i come back here and refresh the page | + | |
- | the message this is in english | + | |
- | appeared above my list of facets | + | |
- | is working | + | |
- | to french | + | |
- | it says this is not in french | + | |
- | pretend | + | |
- | so the template-based content block | + | |
- | follows all of the same rules and | + | |
- | conventions as the full page templates | + | |
- | so you can use the language suffixes on | + | |
- | the file names or not as you prefer | + | |
- | you can use php templates or markdown | + | |
- | you prefer | + | |
- | it's just a nice way to be able to | + | |
- | quickly and easily embed messages | + | |
- | wherever you need them | + | |
- | the next step | + | |
- | that might be useful would be to have | + | |
- | similar functionality in a | + | |
- | recommendation module so that we could | + | |
- | put messages into search results | + | |
- | as of the recording of this video uh we | + | |
- | haven' | + | |
- | thing but it would be pretty | + | |
- | straightforward to do so so if anyone | + | |
- | has a need for this by all means feel | + | |
- | free to open a jira ticket and we can | + | |
- | get that feature incorporated into a | + | |
- | future release | + | |
- | in any case | + | |
- | thanks for your time and for listening | + | |
- | to this i hope this makes it easier for | + | |
- | you to share information through your | + | |
- | viewfind | + | |
- | and we'll have more for you next month | + | |
---- struct data ---- | ---- struct data ---- | ||
+ | properties.Page Owner : | ||
---- | ---- | ||
videos/managing_static_content.1636558455.txt.gz · Last modified: 2021/11/10 15:34 by demiankatz