Add Amazon Affiliate links to Netlify CMS Hugo site - markup unsafe=true - iframe

I created the default Netlify CMS site with Hugo to test it out. The first test I wanted to do was to get Amazon Affiliate sites to work. With my actual site, I had to edit the config.toml file to include:
[markup]
[markup.goldmark]
[markup.goldmark.renderer]
unsafe = true
In order for the tags to work.
However, with this newly deployed site, it's using the config.yml file. I tried to edit the file located here: theme-name/site/static/admin/config.yml . See the photo, below.
Nothing seems to work. However, in the preview pane, the ads show up without an issue.
Suggestions?

The problem was the path. I had to add this code:
[markup]
[markup.goldmark]
[markup.goldmark.renderer]
unsafe = true
to the [theme-name]/site/config.toml file.
There were at least two config.toml files in different paths. Also, there is a config.yml file. It was a matter of choosing the right path.

Related

Wysiwyg image is showing up in media/wysiwy not inside pub/media/wysiwyg. How do I fix this?

Okay so I have a Magento 2.4.5 project where I am facing some issues like images not loading up because they are being looked up inside pub/media/wysiwyg instead of media/wysiwyg. I have some wysiwyg images inside pub/media/wysiwyg/<some_image_directory>, however on the live site the directories and files are showing up as media/wysiwyg. How can I make sure that a separate pub/media/wysiwyg directory is created in the live site apart from the media directory that is already there such that the image loads up properly? We are using nginx which is opening up at 'pub' directory as the root where the media directory resides. Any help is appreciated.
I tried checking for the piece of code where the image is coming from in an attempt to see if the path can be changed programmatically by removing the 'pub/' part from the pub/media/wysiwyg/ for the live site. However, that is not something that can be done as that will change things project-wide, which might break other things. Hence that is not being done.
First, you need to make sure that you are running the site from the root folder i.e. public_html on the server.
Steps to reproduce:
1: Run the command to load content:
bin/magento setup:static-content:deploy -f
2: Next command: chmod -R 777 pub/*
3: Set the secure base media URL and unsecure media URL from Magento database which you recently created and find the table core_config_data and change the path value as:
web/secure/base_media_url => https://example.com/pub/media/
web/unsecure/base_media_url => https://example.com/pub/media/
Or from Magento Admin
Stores -> Settings: Configuration -> General -> Base Url's -> Base URL for User Media Files
and to
Stores -> Settings: Configuration -> General -> Base Url's (Secure) -> Base URL for User Media Files
Flush Cache
4: Might be missing .htaccess in your /pub/media/ folder.
5: Check your .htaccess file, if there's bad code.
Thanks
Okay so I figured out the issue.
I was running the website from the pub directory as I should however there was a third party plugin which had some hard-coded src set by the owner for images set as /pub/media/wysiwyg in the adminHtml since they were using an older version of Magento which used to place images inside /pub/media/wysiwyg instead.
So I just changed it to /media/wysiwyg over there and everything works as expected.
Tbh the whole issue was quite hacky as the owner seems to have put a script inside the third party module's description section in the adminHtml and is using hard-coded links such as this.
Thank you all for the comments. :)

Hugo not rendering the public folder locally

When I use the command hugo, it generates the index.html in the Public folder. When I open index.html, the site load like this:
But when I use the hugo serve command locally, it generates the link http://localhost:1313/, and the site load properly. It loads like this:
I think the problem is because of the not proper rendering of files or anything similar.
My approach:
I added the code relativeURLs = true and uglyURLs = true at top of the config.toml file but still it does not rendered properly.
I had set baseurl = "/" in config.toml file but this also does not work.
Your theme might be loading CSS using {{ .Site.Baseurl }}.
For example:
<link rel="stylesheet" href="{{ .Site.BaseURL }}css/style.css">
In that case, make sure that the BaseUrl defined at the top of your config.toml file is set to http://localhost:1313, which will allow your local server to find the CSS file.
You're CSS file is not loading properly. This can have several reasons, for example:
http url on an https website.
wrong "integrity" hashes on you css file.
css file is not deployed or not on same location on the server.
Google developer tools plugin might help here. If you right click on your web page, click "inspect" and go to console. You can see any loading errors.
You can install Web Server for Chrome and choose the /public folder of your Hugo website. Your site should now render correctly at the url configured (http://127.0.0.1:8887 in the example screenshot).
You might want to set baseURL to the absolute path of the public folder.
Fixed this by configuring baseUrl in config.toml.
If you're deploying using GitHub pages, you'll want to make your baseUrl equal to your github pages domain.

Images styles are not created in drupal 7

I have a website in drupal 7.53. When I try to upload an image in my article, it shows the image as a cross (image not found). For testing pruposes, I've set my folders to 777:
sites/default
sites/default/files
sites/default/files/tmp
But no luck.
Edit:
I've changed the "clean url" option to no clean urls and now it starts working. So I've replaces the .htaccess file to the default drupal file, but still no luck when I turn on "clean url".
From my experience most common reasons that can cause image style image creation failure are:
GD library not installed or not working properly
Wrong file permissions (php can't upload/write file)
Domain access module (it's "Locale" sub-moduel) - there's a bug in that module which messes up the image paths.
.htaccess file (some wrong options)
What I would do is try the fresh installation on same environment and if it's working well there or not and then I would switch off temporary module by module to see what is causing this issue. Also try switching to default Drupal's theme to see will it happen with it too.

Which directory/folder should I upload my index.html (homae page) in?

this picture features the cpanel of the website I own. Check the image carefully and you will find out that there's "nothing" to be shown in "public_html" folder. But when ever I visit my domain (www.tumajnuri.com) I see the advertising banner of the service I bought the domain from. As an amateur, this is the first time I decide to upload web pages. I already learned this fact that "public_html" is the default "root" folder of many domains, but nothing exists within this folder. I should find out which folder contains this "jpg" file so, I can delete and replace it with my index.html. Thanks!
My cpanel: http://www.tiikoni.com/tis/view/?id=8826319
The default that you can upload/change is the public_html/index.html.
If you do not upload anything there is an other default that you can not change.
It is the domain/hosting service's html.

What should I check for when I cannot upload files into filefield CCK fields?

I have recently moved a drupal site. (both servers run on a debian based LAMP stack) Everything works great here, including the uploading of images via a CCK filefield. Original url:
dev.example.com/foo
Deploying it to a test folder on the production server to a test folder for an environmental shakedown cruise lead it here:
www.example.com/foo
Everything works here too, including image uploads. After adjusting sites/default/settings.php, then making it readonly again, I renamed the folder to its production name:
www.example.com/bar
Everything works fine here except for image uploading. I've adjusted the webroot variable within settings.php .
Things I have tried so far:
Gave php system user write permissions to sites/default/files (images are set to go in sites/default/files/images but imagecache just puts them in sites/default/files)
Enabled file php file uploading for www.example.com/bar/sites/default/files
Are there any other configuration settings I should be looking out for here? I'm running low on relevant solutions.
Edit: I had quite the typo there, I adjusted sites/default/settings.php, not sites/default.settings.php .
Your question is slightly confusingly framed. default.settings.php has no impact on Drupal -- its merely a template. The file that contains the actual database connection information and other configuration is settings.php.
You may also want to look at your .htaccess file in your root Drupal folder and try changing the RewriteBase directive to the folder you are accessing your site on. Usually you should not have to change the $base_url directive in the settings.php file that you may/may not have done. Reverse that change for now if you have (you may need to play around with that later though).
imagecache will always upload the image derivatives in sites/default/files but imagefield will upload the original image in the folder you specify (within sites/default/files). You will get a setting for the imagefield under Manage Fields->[Name of Image field]->Configure under Path Settings.
Please google to understand the difference between imagecache and imagefield. Make sure your sites/default/files (and subfolders) are writable by the apache user (usually www-data).
In such situations, its usually a good idea to pick up a book on apache (if you haven't already) and try to understand how it works. It will be time consuming but will help you out in the future when you encounter configuration issues like this.
This worked for me. When having issues uploading images to a cck field, I gave write permissions to directory:
sites/default/files/field/image

Resources