DocFX - how to place an export to PDF button on header/footer - docfx

I'd like to place a button on the header/footer of the docfx generated site that is when clicked it downloads an already generated/saved PDF in the asset folder of the site.
Tried to scour the web for documentation on how to go about this but I don't think this is documented that well.
Any feedback will be appreciated.

To do so you should create a new template. DocFX provides a basic tutorial to do so (here).
In the new template you should copy the navbar.tmpl.partial file (resp. footer.tmpl.partial) in the _exported_templates/default/partials/ folder to modify the header (resp. footer). In these, you can add an anchor section as suggested in here.
You will have less trouble modifying the footer who is "pasted" as it is in the master layout (The navbar is populated using javascript).
Don't forget to apply the new template in your docfx.json file.

Related

Silverstripe not using HomePage.ss as Chrome?

Hi I followed the Silverstripe lesson https://www.silverstripe.org/learn/lessons/v4/working-with-multiple-templates-1, and even tried to download the code from repository but when I tried to create templates/HomePage.ss as chrome Silverstripe still uses Page.ss. Clearly lesson says "It first looks in the main templates/ directory to find the chrome for this page. If it finds HomePage.ss in there, it will select that as your chrome." What is missing?
The issue here is that you are conflating the idea between a Page template, and a HomePage template.
The Page 'chrome' template (as the lesson calls it) resides in templates/ because Page class is not namespaced, or that is it resides in the root namespace.
The HomePage class on the other hand is namespaced, and this must be reflected in the path to the template.
A main template (the 'chrome'), the template should be in templates/SilverStripe/Lessons/
A Layout template should reside in the same base, but with a Layout folder; templates/SilverStripe/Lessons/Layout
This information is featured in the lesson.
I understand you are frustrated, but spreading fear uncertainty and doubt about bugs before finding the answer to your question is not a nice thing to do.
You need to create a few folders in the templates folder, as described in that lesson:
Make a directory called templates/SilverStripe/Lessons. In that directory, create another directory called Layout/. In that directory, create HomePage.ss. The full path should be templates/SilverStripe/Lessons/Layout/HomePage.ss.
So you basically need to move your file from templates/HomePage.ss to templates/SilverStripe/Lessons/Layout/HomePage.ss
Silverstripe is buggy, I got same issue. Just switch to Wordpress.

How to get my custom calculator to display on wordpress page?

I built a custom calculator using HTML5, CSS3, and jQuery.
I have a basic hosting account and loaded all the files through cPanel to my root directory. The files include calc.html with a CSS folder holding my stylesheet and a JS folder holding my custom jQuery.
Now someone would like to put my calculator on their Wordpress site and we can not figure out how to do it. For now I just used iframe to show my site on their Wordpress page but we want the calculator to be hosted from his site.
I tried copying and pasting my HTML code from my calc.html file into a Wordpress page which works but I do not have the styling of my CSS and the JS dose not function. So I used FileZilla and created a folder called CALC with the follwing path (public_html/wp-content/themes/parallaxpro/cyberchimpscss/calc/) and added the JS sand CSS contents in there.
I linked my CSS in the header of my calc.html code
<link rel="stylesheet" href="public_html/wp-content/themes/parallaxpro/cyberchimpscss/calc/css/mainCalc.css">
I linked my JS towards the end of the body in calc.html
<script src="public_html/wp-content/themes/parallaxpro/cyberchimpscss/calc/js/main.js"></script>
I view the page and still have my ugly HTML code with no styling and no JS functionality.
Im new to Wordpress/coding and this is the first thing that popped in my mind so I tried it and failed.
I also thought I could put calc.html, mainCalc.css, and main.js inside of the calc directory i created(public_html/wp-content/themes/parallaxpro/cyberchimpscss/calc/)
and then use iframe to display calc.html on the wordpress page. I also failed at this.
I used
<iframe src="public_html/wp-content/themes/parallaxpro/cyberchimpscss/calc/calc.html"></iframe>
You could do with creating a custom page template.
Basically you will follow the docs https://developer.wordpress.org/themes/template-files-section/page-template-files/page-templates/ and create a page with the HTML + CSS + JS in the content part.
When you done, you just create a new page in the admin part, select the template from the list under the publish button. Save it, and that's it.
Its simpler from writing a plugin.

Import template to Magnolia CMS

I'm currently working with magnolia cms 5 and I know how to import xml templates. Now I need to import html5 page template, just I did not find how in documentation, and I do not belive it is impossible.
You have multiple options to achieve what you want.
If you want editors to be able to edit content of the page, you need to put html in FTL file (that you can put on class path or create on the fly in STK/Templates) and replace editable parts with markup to be filled from the user input. You would also need to create template definition, make template available to editors and create dialog. See Creating Magnolia Page Template for more details
If this html is static and not editable by users, you can still put it in FTL or you can place it in /docroot/ folder to make it available under http://your-magnolia/docroot/your-webpage.html url.
If you have magnolia module already, you can also place that html in mgnl-resources folder in your module and have it accessible via http://your-magnolia/.resources/your-webpage.html
You can also go to STK/Resources and upload your page there and have it accessible under http://your-magnolia/resources/your-webpage.html
HTH,
Jan

Managing Wordpress Theme

A Wordpress theme has following components:
theme.zip file
demo-content.xml
PSD.zip file (contains files such as icon-blog.psd, icon-home.psd, integrity-blog.psd, ... renew-home.psd)
Using WP Admin (WP Backend) I have managed to upload theme.zip file.
Using WP Importer I have managed to upload demo content.
However, what do I do with PSD files?
I would like to add that the current frontend looks very basic. And I assume PSD files serve to enrich frontend. But how do I use them? Where do I "import" them? How do I do it?
After taking a look at the comments, I have to say that if the tag exists, the answer should be answered here too.
Your .PSD is basically all the images that compose your theme in one editable file.
The extension of the file is meant to be opened with Photoshop and if you open it there, you should see the design of your theme ready to be cut and applied into HTML and CSS.
For Wordpress or your site it has no utility by itself, however, if you want to change some button, icon or related it's just a matter of open the editable, change it, save the image and replace it on the server.
Ex:
You bought a theme initially developed in English and you have a button which is an image that says "Register". Since it's not editable, there's no code change that can help you, so the only way you have is to open the .PSD, edit the button and save it again as image, replacing the old one.

How can I change the way my Drupal theme displays the front page

I am trying to build an website for my college's magazine. I used the "views" module to show a block of static content I created on the front page.
My question is: how can I edit the theme's css so it changes the way that block of static content is displayed?
For reference, here's the link to the site (in portuguese, and with almost zero content for now).
I can't access your site at the moment, so I'm basing this on fairly limited information. But if the home page is static content, the views module might not be appropriate. It might be better to create a page (In the menu, go to: Create content > page), make a note of the page's url, and then change the default home page to that url (Administer > Site Configuration > Site information, 'Default front page' is at the bottom). Although I might be misunderstanding what you mean by 'static content'.
But however you're creating the front page, don't edit the css in the theme - it'll get overwritten next time you upgrade. Instead you need to create a sub-theme.
As an example, if you want to subtheme Garland, in drupal 6. You first need to setup a directory for your themes. Go to sites/all/ in your drupal installation, and create a subdirectory called themes if it doesn't already exist. Go into that directory, and create a directory for your subtheme, say mytheme (i.e. sites/all/themes/mytheme/). Then use your text editor to create a file called mytheme.info in that directory, with the contents:
name = My Theme
version = 0.1
core = 6.x
base theme = garland
stylesheets[all][] = mytheme.css
And then use your text editor to create a file called mytheme.css in that directory, and put the extra CSS in there.
For more information, there's the druapl documentation on .info files and style sheets. Although, you might want to buy a book, as the online documentation isn't great.
The main css file that drives your content is the styles.css file located in your currently selected theme. In your case that means that most of your site styling is driven by this file: /aroda/roda/themes/garland/style.css with basic coloring effects handled by this file:
/aroda/roda/files/color/garland-d3985506/style.css
You're currently using Garland, the default Drupal theme included with the core download, so for best practices you shouldn't edit the included style.css file directly. Instead, you should, as Daniel James said, create a subdirectory in /sites/all called "themes".
If you're using Drupal 6, I'd follow Daniel James directions from there. If you're using Drupal 5, I'd go ahead and copy the garland directory into the themes directory and rename it for something specific to your site (aroda_v1) so you would have something like /sites/all/themes/aroda_v1 which would contain styles.css. At that point, you can edit the styles.css file directly to make any changes you see fit. Hope that helps!
It looks like most of your CSS info is in some *.css files. There is also some inline Style info on the page. Your style for the static info comes from the in-line stuff. I am not sure how Drupal generates the page but the place to start looking is for any properties for "ultima-edicao". That is what the surrounding DIV is called.

Resources