Codeigniter/PyroCMS Extending use of files - php

I need to produce a few pages that will enable me to display lists of documents (.PDF)
What I want to know is there structure or the compatibility to use the file manager
Example:
I create a folder called animals and inside this folder I have a document called monkey.pdf and tiger.pdf
on the front end of my site I will have a page called articles -> This page will need to list all of the folders created in the file manager
When someone clicks the folder Animals I would like it to list all of the .pdfs within this specific category
Is this possible and could someone show me an example as I am confusing myself.
This is very much appreciated

I have had a thread reply from my query on the PyroCMS fourm.
This is possible it has just not been documented yet and you need to look in the files document for how it works.

Related

What is the best way to create page in Drupal 8 so that I can then add these posts with images?

I have a Home page on the Drupal website (such as is created after installation), but I still need to create this page:
What is the best way to create a page so that I can then add these posts with images?
I am just starting to learn Drupal and have heard so far about such ways of creating pages:
1) in admin toolbar: Content / Add Content / Article
2) in admin toolbar: Content / Add Content / Basic page
3) in admin toolbar: Structure / Views / Add Views
Which one should I use? Or maybe there is some other option that I don’t know about?
P.S. At the moment I am more interested how to create empty page on which I can then add posts later, and adding posts it is another question.
Welcome to Drupal.
Drupal ships with the default theme which won't look nice but it does its job in the right way. Now if you want to create a better UI/UX obviously you should create a new theme. But before that make sure to read and understand the concepts behind Drupal. Drupal docs are your first friend.
Drupal Documentation
Drupal considers everything as nodes and that's how Drupal got its power. As you mentioned, Articles, Basic Page etc are called content types and they can be used to create a particular type of content.
Now for your purpose create a new content type and add the fields you need. From the image above I can say your content type needs Title, Image, Category and Date. After creating content type you can create as many contents as you want under the content type you just created. Consider each card in your image as content.
Now you can use a Drupal Core Module Views, to perform DataBase Operations without writing single code. Yes, you can select fields, sort, order etc with Views UI and display it in a page or a part of a page (Block).
I would say just try this out in the default Drupal theme and when you understand how this works, you can start creating your own theme for your project.
Theming Drupal
There is a lot of resources available. But you have to make sure what you are asking is whether you actually need. It will take some time, but it worth.
To build layouts for homepages on Drupal 8 you best friend is https://www.drupal.org/docs/8/core/modules/layout-builder
To build the content blocks inside your home page, you should start creating nodes on a node content type to hold your information. For instance: news content type, with a title, a body, a date, and an image.
For every node type, ex. news, work on the preview display, full display, and any other display which makes sense. These displays can be used later in the Layout Builder directly or in Views, referenced below.
If you wish your list to be dynamic, such as the last 10 entries are shown first, then use a view to hold the content sorted and filtered as you need.
In a nutshell.
Create a content type for your article/news.
Modify the displays of the content types to have at least a summary and full view.
Create the content itself to have something to see.
Create the view (block) to filter and sort your content.
Create a page layout (this makes sense for landing pages) which places your new view and any other content you need in any disposition.
This is roughly what I would do. The steps described above contain many intermediate steps. If in doubt, check the docs.
I hope that helps!
First, decide what will you display on that page. Is it content in some existing content type (article maybe) or you want to crate new one for this purpose.
If you need new one then create it (Structure -> Content types -> Add content type).
Then check what fields will you need. I.e. image, some description text. Add missing ones.
Create few nodes (pages) in that type so you could work with them.
Then for displaying you should crate a view (Structure -> Views -> Add view). It can be a page view (you are displaying only that content on page) or block view (this is just a block among some others). If you create a page you could visit it and if you create a block you have to add it to some region to appear on page (Structure -> Block Layout).
Inside your theme you should create templates for this page/block. Turn on twig debug mode so it will show you hints - what templates are used and how can you name yours to override default ones.
Adjust CSS to make it look like you want it to look.
Find some tutorial(s) for the details
Previous answers have given the flow of the work you should go through, I would like to add some resource that might help you achieve this.
Creating content type and fields: https://www.drupal.org/docs/administering-a-drupal-site/managing-content-0/working-with-content-types-and-fields
https://www.drupal.org/docs/user_guide/en/structure-content-type.html
View and View modes: https://www.drupal.org/docs/user_guide/en/views-concept.html
https://www.drupal.org/docs/8/api/entity-api/display-modes-view-modes-and-form-modes
Handling block of the view: https://www.drupal.org/docs/8/core/modules/block/overview
Feel free to ask if any further explanation is needed.
Thank you

joomla module to create multiple pages

I have a need for the ability to create web pages that are image galleries and link them to other pages/galleries.
For example, each page would be a gallery of photos, and I would like to be able to link (forward and backwards) to the other gallery pages.
So, Project-1.html -> Project-2.html <--> project-3.html <--> project-4.html
Where each "project" is a gallery of images.
Now, I can of course make a module to make/edit an image gallery, but ... how do I also allow for the creation of the other projects? Which are pages?
Should I be looking into making articles which contain modules?
Or, do the modules themselves already allow for something like this?
Or, should I just make one page/one module that does some lazy loading and completes this task on one page (that appears and behaves like multiple pages)?
If I were to do this now - with my current Joomla knowledge - I would do it on one page and use lazy loading; I'm essentially asking what Joomla offers, on this front.
Simply create an article for each project and add the gallery inside the article you want (if you want to use the modules for gallery you can embed it inside the article too).
Then if you put the articles in the same category you can browse them back and forth through the default buttons.

how to make news and articles using the same silverstripe news module?

I need to incorporate News and Announcements in my silverstripe website, both news and announcements have the exact same structure and they both use https://github.com/nyeholt/silverstripe-news. in the html template I have two sections one for the news and another for the announcements.
what is the proper way to implement this:
should I just copy and past the /news module folder and use one for the news and the other for announcements.
or add another db field as flag to specify if this is a news article or an announcement article, but then in the cms the user would have to check this every time.
or is there anything else, I don't know
Duplicating the folder would not have the result you expect unless youd rename all the classes in side of the new one.
Basically the folder is just a place for the classes to be, not something that you access when you actually request an news article, you use SilverStripes routes for that.
Static assets would be something that are be loaded from a module folder.
The best way to add a new behaviour to an extension is to use a DataExtension.
See https://docs.silverstripe.org/en/3.4/developer_guides/extending/extensions/
Other way would be if the module uses sitetree for placing the "news holder". Then you have the option also to just create two holders with different names and then if you want to show a list of a paricular parent just filter with the parentId that relates to the correct holder.
Third option would be to just would to add a new class under mysite that extends the modules classes and override only SOME of the methods to suite your needs.

Wordpress template names not appearing

I have been searching for answers to this problem for over 2 hours now and need help.
I have been working on a site for a client and want to make it into a wordpress them so that they can edit content without my help.
A few of the pages will need to have a template. So far I have 5 named custom templates within my theme.
Home Page
Support
Consultation
FAQ
Terminology
The pages are nested in different folders to create clean urls like so:
zulu_theme(main_dir)
zulu_theme/homepage.php (template name: homepage)
zulu_theme/consultation/index.php (template name: consultation)
zulu_theme/support/index.php (template name: support)
zulu_theme/support/faq/index.php (template name: faq, template name not showing)
zulu_theme/support/terminology/index.php (template name: terminology, template name not showing)
I have checked the problem files to see to see if I specified the name correctly. Both of them have /* Template Name: -template name */ correctly formatted on the second line of the document like the others.
I have tried changing the theme back to default and resetting it, however that doesnt work either.
I moved the zulu_theme/support/faq/index.php file to the theme folder to the zulu_folder/ and the faq name showed up, so I think that it is a permissions issue. However, when I check the folder and file permissions everything looks okay.
Has anybody else run into this issue, and found a solution?
I have tried using themes within 1 level of subfolders and they work. I haven't tried going further levels down but i think you should try keeping it simple. Also replace the file names with relavant names. If i was in your position i would try to use this structure.
zulu_theme/templates/homepage.php
zulu_theme/templates/faq.php
zulu_theme/templates/terminology.php
...

Add new entities in OpenCart

I was wondering if I can add new entities (classes/tables) in OpenCart to store information that is not included in the default functionality. To be more precise, I would like to add subscription (3/6/12 months) related information, as described here: OpenCart subscription model (x months)
If yes, can I just add admin pages for the new class? Would something like: How to create a custom admin page in opencart? work?
You would need to create a
Template file (.tpl)
Controller file (.php)
Model file (.php)
Language file (.php)
All files are named the same with different extensions and located in their respective folders
You will also need to add more columns in the database named with the additional settings you ant to store.
In addition to your page specific setup you will also need to add a link to your page in the header file, in the menu.
You will use the model file to insert, update and delete data within the database. The controller controls what functions within the model are used.
Once created, In admin/ user group permissions you need to give access o the new pages
Take a look at the existing files to see how it works. Make a copy of one of the more simpler 4 files, rename, then start to modify them.
If you only want to add more settings to a existing page then you can add them to the existing 4 files and add columns in the database.
Hope that helps get you started, Good luck!

Categories