Creating a stats page in SilverStripe CMS - silverstripe

SilverStripe 2.4.7
Hi
I want to create a stats page in the CMS but I'm not entirely sure how to do this. If it were an ordinary PHP page I would query the database, save the values to an array and display them in a table. I need it to look similar to the other CMS pages too.
I have included my own php files for other things in the CMS so I was wondering can I do the same here?
Thanks

WIthout providing more details, all I can do is point you to the Site Reports documentation for SilverStripe 3.
This will allow you to show your DataObjects in table form, based on filters and sorting that you choose.
If the basics of SS is what you're after, start with the tutorials.

Related

Sharing app content between portals using 2Sxc

I need to design a content system similar to the news article 2sxc application. However, in my situation I have a primary subdomain and multiple secondary subdomains each of which is a portal in a single install of DNN. I need the primary to be able to selectively share articles with the secondary subdomains. I also need the secondary subdomains to be able to have their own articles. I have explored creating a ghost content type on the secondary sites, but this doesn't seem to share the content. I have used the visual query designer with an App Data Source to pull data from the zone and app of the primary. Using this, I can pull the needed article data, however, it also pulls lots of meta data like the name of each field on the content type etc. So I assumed I could filter this stream by content type, but when I do that it removes all items in the stream. Additionally, I have tried using razor code to get the correct data, but have been unsuccessful. So:
What is the best way to accomplish sharing the articles as described?
What am I missing on the visual query designer that is causing it to filter all results when filtering by type?
Thanks
If I understand you correctly, for 2, you are using the App Datasource. In the docs (linked), have a look at the first screenshot and the note above it. By renaming the streams coming out of the source, you automatically filter on the CT.
And for 1, I do agree that using Queries seems like a great choice.
There are a few more options to achieve this BTW
You can just show a module of Portal 1 on Portal 2 using Dnn features to share modules
Use the mechanics described by #Jeremy in his answer
2sxc 13.2 will offer a new shared-global-app system which is actually meant for other scenarios, but could also be used here.
You could also provide the data on your primary site as a RSS or WebService, and re-use that on the target site

Drupal know from where things are showed

I have a strange question but I don't find any hint about that (if it's possible), for a drupal 7 website I have to modify some content of a page in the backoffice, but I really don't know from where some content of this page is created (a table, similar to a view table but not a view table).
I just want to know if there is any way to show which php function the page use to finally be showed. I know there is something like that for the theme (drupal theme debug) but I don't find something for my case.
Any idea ?
You need PHP profiler to check all functions called on page, there's a module for Drupal7 for XHProf integration. But I would suggest you to use your browsers inspector as mentioned by 2pha before. For example if there's a form on the page just use the form ID to find it. Custom classes are very useful in these cases, parts of the html codes etc. In your case search for table headers...
The code you are looking for is most probably in custom modules and the
general suggestion is to keep you custom modules in separated folder from contributed ones.

Custom code in Wordpress: what are the programming limitations?

I have a website (www.easterisland.travel) that I'm considering converting into a Wordpress site. Why? Basically for the following reasons:
1: To use a CMS, so that I can teach others to further add content to the website without having programming knowledge. I would built the advanced pages myself though, and the pages that others would manage would be simple information pages.
2: Access to all of these great plugins, for example the "similar pages" plugin at the bottom of each page (which I haven't found as a independent solution for raw webpages), which is just fantastic to keep people reading.
At my site I have lots of custom stuff like booking systems that I've created. There's an AngularJS shopping cart (www.easterisland.travel/tours/), instant online booking and payment (using PayPal's Express Checkout) etc. There's a page for cruise ship shore excursions (www.easterisland.travel/cruise-ship/) that's automatically generated from database data, and I've created a system where I can add cruise ships and shore excursions (adding correct itinerary, price, info etc). Passengers can also log in and communicate to other future fellow travelers within the same group, and get organized for meeting up on the tour day. I have many more plans to go as well, for example showing hotel info, displaying TripAdvisor data (using TripAdvisor API) etc.
The million dollar questions are:
1) Can all of this be achieved in a Wordpress site? Can I add all of these systems using this platform? What are the limitations?
2) Would it make sense to change to Wordpress?
3) What implementation should be used? I don't want my code to be removed or altered when Wordpress is automatically updated.
Thank you!
Wordpress doesn't have any limitations, you can extend its default functionality if it can't accomplish what you need with either plugins or custom code. and having a framework is always better than building from scratch in many ways.
HOWEVER, wordpress was originally design as blogging platform, and if you plan on extending its simple functionality you should take some time to understand how it works to properly integrate your custom needs or things could get ugly,
If you know how to interact with the database, you can easily do what you want, there are built-in functions you can use according to your needs for database interactions or just create your own if it doesn't fit well very much.
just a quick overview with wordpress database.
wp_posts - where sites main front-end data are stored, like posts, pages,
wp_postmeta - storage for additional data that are stored on wp_posts
wp_comments - storage for user interaction data for wp_posts like comments, I've also used these before to store user/admin messages.
wp_terms - use for dividing/categorizing wp_posts data, like categories and tags,
wp_options - use for back-end storage data and configuration.
You'd need to check out these functions as you're probably will encounter them in the future
https://codex.wordpress.org/Function_Reference/add_post_meta
https://developer.wordpress.org/reference/functions/get_post_meta/
https://codex.wordpress.org/Function_Reference/update_post_meta
https://codex.wordpress.org/Function_Reference/register_post_type
https://codex.wordpress.org/Function_Reference/register_taxonomy
https://codex.wordpress.org/Class_Reference/WP_Query
If you also need database interaction, check out https://codex.wordpress.org/Class_Reference/wpdb
and for front-end implementation, check this out https://developer.wordpress.org/themes/basics/template-hierarchy/, though I never used any other wordpress theme except Genesis Framework for these past 5 years as I never had to mess too much with HTML codes and almost everything can be customize using actions & filters. I advise you to use Theme Framework (and remember to always use CHILD THEME to be safe from Main Theme upgrade)
You might also want to check -> https://github.com/WebDevStudios/CMB2 (I prefer to use this than Advance Custom Fields plugins.)
Booking system in wordpress is a bit complex, I've successfully use gravity form as booking system with AngularJS + Ajax, but never tried a custom one from scratch and don't have a chance to use booking plugin as never encountered a cleint that wants a simple booking system.
Just to answer your question.
Yes, It can, for comparison, take a look at woocommerce plugin functionality and features, I believe thats more complex than what you need.
It would make sense to convert a site built from scratch to any CMS (wordpress is an option), the CMS is up to you, though its better to use the one that you know more for easier integration and customization.
You can use your child theme "functions.php" for extending your custom functionality, like create a folder in your theme for all your custom code and include/require it on your child theme functions.php or better create your own plugin to properly integrate them, you can divide the functionality in plugins, like plugin for booking system and plugin for payment functionality. check this out https://github.com/hlashbrooke/WordPress-Plugin-Template
I hope this would give you an idea.
Yes you can do all that. You will need someone with knowledge in wordpress themes and plugins but it is possible. The beauty of wordpress is, that you can write "bare" php code, and the small amount of functions to interact with wordpress are well documented.
Wordpress itself, is structured "simple" (compared to fancy tools like magento for example). So all it manages, are posts / pages / ... which, more or less derive from the same database object. You can add functionality to those things (for example, make posts cruise ships and other posts to shore excursions) or you can add your own database structure on top.
The theme system is bare php code, so you dont have to crawl through a thousand lines of xml codes to adjust little things.
Wordpress power derives from its simplicity of the "core wordpress" and the feature volume based on all those plugins. I believe alot of people would say, that you should go for a custom solution (based on symfony for example), or a CMS that already comes with more of your desired functions (like magento which has the checkout / paypal included), but I (as a wordpress fan) would see no problem to take wordpress.
I have never failed to find a plug-in to do what I needed! I manage three WordPress sites - although none of them is commercial. (Yacht Club, Cycling Club and Political Party EDA).
There is a plug in that allows PHP on any WordPress page, but it means that the Editors all have to write using the text (HTML) view rather than Visual tab. I found that useful for some of my pages - and I'm the only "Editor."
There's also a plug-in that allows you to code PHP in Widget. That doesn't have the above disadvantage.

Goal: Is it possible to integrate an Asp.Net website with Joomla CMS

I have an asp.net application which is purely build using C#, CSS, Javascript. Now i need to integrate my application with joomla cms.
**Is it possible to integrate an Asp.Net website with Joomla CMS**
Any help would be deeply appreciated.
Yes it is possible, and depending on what you are trying to "integrate" it might be fairly easy to do. First, you will need to get ChronoForms and ChronoConnectivity. Without having any more details here is what you would need to do -
Put the Joomla DB in the same database. By default Joomla uses the prefix jos_ for its database tables so this should not pose any issues. This will make it easy to access the tables of your application within Joomla.
Next you will need to create a form that has a field for each corresponding field in the table you want to edit. You will need one form for each table.
Using ChronoConnectivity you then associate the form with the table in the database.
This is pretty basic but it will give you the ability to edit any table in the same database that Joomla is installed in. You may have to get a little trickier to make it work well, but you can insert additional code in both ChoronForms and ChronoConnectivity as needed.
That would probably be the fastest and easiest way to do a simple integration.

Creating dynamic region content in wordpress as in drupal

I've been using Drupal to create websites for about 2 months. I find it pretty easy to create a view or a block which could hold my dynamic content like latest photos, comments and all.
Now, i've started using Wordpress and it puzzles me how to do those things. Like, how to create a site like this:
http://theklaxon.com
Should i create a .php file which does what i want and then include the file in the respective places?
There is a couple of options you can explore. The easiest way to include your own block of content is through page template; to make full use of it, you would have to understand the WordPress loop so you can fetch posts from the DB and format it as you like.
Another method, albeit which involves more coding and setup but more scalable in the long run, is the Pods CMS for Wordpress. Do check the introductory articles there for what you can do with it.

Resources