<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Web Design Archives - Dennis Bottaro</title>
	<atom:link href="https://www.dennisbottaro.com/category/web-design/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.dennisbottaro.com/category/web-design/</link>
	<description>Animal Lover, Programmer, Musician &#38; Photographer</description>
	<lastBuildDate>Tue, 21 May 2024 23:22:11 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>Great Plugins: Fonts Plugin &#124; Google Fonts Typography</title>
		<link>https://www.dennisbottaro.com/great-plugins-fonts-plugin-google-fonts-typography/</link>
		
		<dc:creator><![CDATA[dbottaro]]></dc:creator>
		<pubDate>Wed, 15 May 2024 06:05:42 +0000</pubDate>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[Web Design]]></category>
		<guid isPermaLink="false">https://www.dennisbottaro.com/?p=560</guid>

					<description><![CDATA[<p>How can you add custom fonts to your WordPress blog in 2024? By using an updated modern alternative to Easy Google Fonts for customizing WordPress fonts. Fonts Plugin &#124; Google Fonts Typography This is as simple as it can be &#8211; just select the font you would like for the website and the plugin handles&#8230; </p>
<p>The post <a href="https://www.dennisbottaro.com/great-plugins-fonts-plugin-google-fonts-typography/">Great Plugins: Fonts Plugin | Google Fonts Typography</a> appeared first on <a href="https://www.dennisbottaro.com">Dennis Bottaro</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>How can you add custom <a href="https://www.dennisbottaro.com/great-plugins-easy-google-fonts/">fonts</a> to your WordPress blog in 2024?  By using an updated modern alternative to Easy Google Fonts for customizing WordPress fonts.  </p>



<p><strong><a href="https://wordpress.org/plugins/olympus-google-fonts/">Fonts Plugin | Google Fonts Typography</a></strong></p>



<p>This is as simple as it can be &#8211; just select the font you would like for the website and the plugin handles the rest.  Using Fonts Plugin to add fonts to WordPress is an easy task.</p>



<p>You can add as many fonts your WordPress site needs for each HTML element of your site.  Custom heading fonts, custom body fonts and everything else you need are available within the Fonts Plugin.</p>



<p></p>
<p>The post <a href="https://www.dennisbottaro.com/great-plugins-fonts-plugin-google-fonts-typography/">Great Plugins: Fonts Plugin | Google Fonts Typography</a> appeared first on <a href="https://www.dennisbottaro.com">Dennis Bottaro</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Django: Grouper &#8211; Show Additional Fields</title>
		<link>https://www.dennisbottaro.com/django-grouper-show-additional-fields/</link>
		
		<dc:creator><![CDATA[dbottaro]]></dc:creator>
		<pubDate>Sat, 04 Sep 2021 00:49:22 +0000</pubDate>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[Web Design]]></category>
		<guid isPermaLink="false">http://www.dennisbottaro.com/?p=450</guid>

					<description><![CDATA[<p>In a system I&#8217;m developing that handles scheduling, I had a need to add some additional data to a report group header. I tried a few different approaches but nothing worked until I created a custom method on the model I was reporting on. This worked and got the needed data on the report, but&#8230; </p>
<p>The post <a href="https://www.dennisbottaro.com/django-grouper-show-additional-fields/">Django: Grouper &#8211; Show Additional Fields</a> appeared first on <a href="https://www.dennisbottaro.com">Dennis Bottaro</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>In a system I&#8217;m developing that handles scheduling, I had a need to add some additional data to a report group header.  I tried a few different approaches but nothing worked until I created a custom method on the model I was reporting on.  </p>



<pre class="wp-block-code"><code>class MyModel(models.Model):
    job = models.CharField()
    address = models.CharField()
    start_date = models.DateTimeField()

    def custom_group_header(self):
        return self.job + "; " + self.address</code></pre>



<p>This worked and got the needed data on the report, but seemed far too cumbersome to be the correct way.</p>



<figure class="wp-block-pullquote"><blockquote><p>I knew there had to be a better way.</p><cite>Dennis Bottaro</cite></blockquote></figure>



<h2 class="wp-block-heading">The Better Way</h2>



<p>A few days went by and I was asked to add more related data to the report group header.  I almost created yet another custom method but just knew there had to be a better way.  I googled around and came across a <a href="https://code.djangoproject.com/ticket/13452" target="_blank" rel="noreferrer noopener">Django feature suggestion</a> involving expanding a CHOICE field form the choice key to the choice value that was ultimately rejected.  But the rejection comment held the answer I was looking for.</p>



<p>By virtue of the grouper having the list objects you can ask that list for the first object and access it&#8217;s model fields.</p>



<h3 class="wp-block-heading">How to Refer to Additional Model Fields from the Grouper</h3>



<pre class="wp-block-code"><code>group.list.0.field_to_display</code></pre>



<p>So, for my next header change I did the following in the template without having to add unneeded code to the models.py file.</p>



<pre class="wp-block-code"><code>{% for job in jobs %}
	&lt;tr&gt;
		&lt;td colspan="4"&gt;&lt;strong&gt;{{ job.grouper }}&lt;/strong&gt;&lt;/td&gt;
		&lt;td colspan="2" align="right"&gt;&lt;strong&gt;Start Date: {{ job.list.0.start_date|date:"Y-m-d" }}&lt;/strong&gt;&lt;/td&gt;
	&lt;/tr&gt;
	{% for task in job.list %}
	&lt;tr&gt;
		...
	&lt;/tr&gt;
	{% endfor %}
{% endfor %}</code></pre>
<p>The post <a href="https://www.dennisbottaro.com/django-grouper-show-additional-fields/">Django: Grouper &#8211; Show Additional Fields</a> appeared first on <a href="https://www.dennisbottaro.com">Dennis Bottaro</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Django Models Parent Child Template Rendering</title>
		<link>https://www.dennisbottaro.com/django-models-parent-child-template-rendering/</link>
		
		<dc:creator><![CDATA[dbottaro]]></dc:creator>
		<pubDate>Tue, 11 Feb 2020 21:44:55 +0000</pubDate>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[Web Design]]></category>
		<guid isPermaLink="false">http://www.dennisbottaro.com/?p=421</guid>

					<description><![CDATA[<p>Just a quick little tip. It took me quite a bit to time to stumble across this, as the Django documentation does not mention it. If you have a &#8216;related_name&#8217; set for a ForeignKey field on a model, USE that related_name as the MODELCHILD_SET name when trying to access related objects. Working Example Based on&#8230; </p>
<p>The post <a href="https://www.dennisbottaro.com/django-models-parent-child-template-rendering/">Django Models Parent Child Template Rendering</a> appeared first on <a href="https://www.dennisbottaro.com">Dennis Bottaro</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">Just a quick little tip. </h2>



<p>It took me quite a bit to time to stumble across this, as the Django documentation does not mention it. </p>



<p>If you have a &#8216;related_name&#8217; set for a ForeignKey field on a model, USE that related_name as the MODELCHILD_SET name when trying to access related objects.</p>



<h2 class="wp-block-heading">Working Example</h2>



<p>Based on the example Polls app in the <a href="https://docs.djangoproject.com/en/1.11/intro/tutorial01/">Writing your first Django app</a> Documentation.</p>



<pre class="wp-block-preformatted">&lt;<strong>h1</strong>&gt;{{ question.question_text }}&lt;/<strong>h1</strong>&gt;
&lt;<strong>ul</strong>&gt;
{% <strong>for</strong> choice <strong>in</strong> question.choice_set.all %}
    &lt;<strong>li</strong>&gt;{{ choice.choice_text }}&lt;/<strong>li</strong>&gt;
{% <strong>endfor</strong> %}
&lt;/<strong>ul</strong>&gt;</pre>



<p>If you have in your models, the Choice model in your models.py file.</p>



<pre class="wp-block-preformatted"><strong>from</strong> <strong>django.db</strong> <strong>import</strong> models


<strong>class</strong> <strong>Question</strong>(models.Model):
    question_text = models.CharField(max_length=200)
    pub_date = models.DateTimeField('date published')


<strong>class</strong> <strong>Choice</strong>(models.Model):
    question = models.ForeignKey(Question, <strong><em>related_name='choices',</em></strong> on_delete=models.CASCADE)
    choice_text = models.CharField(max_length=200)
    votes = models.IntegerField(default=0)</pre>



<p>You will need to use that <strong>related_name</strong> in place of the <em>modelname_set</em> in the template to access the child objects. </p>



<p>Thus, your template would need to look like this otherwise you won&#8217;t get any objects from the ForeignKey relation.</p>



<pre class="wp-block-preformatted">&lt;<strong>h1</strong>&gt;{{ question.question_text }}&lt;/<strong>h1</strong>&gt;
&lt;<strong>ul</strong>&gt;
{% <strong>for</strong> choice <strong>in</strong> question.<strong><em>choices</em></strong>.all %}
    &lt;<strong>li</strong>&gt;{{ choice.choice_text }}&lt;/<strong>li</strong>&gt;
{% <strong>endfor</strong> %}
&lt;/<strong>ul</strong>&gt;</pre>



<p>I sure hope this helps someone scratching their head and endlessly checking their model names.</p>
<p>The post <a href="https://www.dennisbottaro.com/django-models-parent-child-template-rendering/">Django Models Parent Child Template Rendering</a> appeared first on <a href="https://www.dennisbottaro.com">Dennis Bottaro</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Great Plugins:  Easy Google Fonts</title>
		<link>https://www.dennisbottaro.com/great-plugins-easy-google-fonts/</link>
		
		<dc:creator><![CDATA[dbottaro]]></dc:creator>
		<pubDate>Wed, 16 May 2018 01:21:36 +0000</pubDate>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[Web Design]]></category>
		<guid isPermaLink="false">http://www.dennisbottaro.com/?p=110</guid>

					<description><![CDATA[<p>I was hunting around for a simple method of customizing fonts on this site and came across Easy Google Fonts.&#160; This literally lets you create sets of CSS tags to apply custom Google fonts as well as system and theme fonts.&#160; Just create a font set, then set all of the available properties via your&#8230; </p>
<p>The post <a href="https://www.dennisbottaro.com/great-plugins-easy-google-fonts/">Great Plugins:  Easy Google Fonts</a> appeared first on <a href="https://www.dennisbottaro.com">Dennis Bottaro</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>I was hunting around for a simple method of customizing fonts on this site and came across <a href="https://wordpress.org/plugins/easy-google-fonts/">Easy Google Fonts</a>.&nbsp; This literally lets you create sets of CSS tags to apply custom Google fonts as well as system and theme fonts.&nbsp; Just create a font set, then set all of the available properties via your theme customizer&#8217;s new &#8220;Typography&#8221; setting.</p>



<h3 class="wp-block-heading">Please note as of May 2024 this plugin appears to be abandoned.</h3>



<p>Be very wary of using any plugin that is not actively maintained as it can lead to any number of possible security vulnerabilities.</p>



<p>Check out this post for a <a href="https://www.dennisbottaro.com/great-plugins-fonts-plugin-google-fonts-typography/" data-type="link" data-id="https://www.dennisbottaro.com/great-plugins-fonts-plugin-google-fonts-typography/">modern alternative to Easy Google Fonts</a>.</p>
<p>The post <a href="https://www.dennisbottaro.com/great-plugins-easy-google-fonts/">Great Plugins:  Easy Google Fonts</a> appeared first on <a href="https://www.dennisbottaro.com">Dennis Bottaro</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>WordPress Themes</title>
		<link>https://www.dennisbottaro.com/wordpress-themes/</link>
		
		<dc:creator><![CDATA[dbottaro]]></dc:creator>
		<pubDate>Sun, 13 May 2018 07:44:56 +0000</pubDate>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[Web Design]]></category>
		<guid isPermaLink="false">http://www.dennisbottaro.com/?p=83</guid>

					<description><![CDATA[<p>So, I&#8217;ve swapped from Libretto to FullWidther since I just wanted a wider main content area.  What I really should do is dig in and make a child theme based on the attributes of both themes that I really like.  Libretto has LOVELY typography, like seriously, really classy damned text, but its very narrow content&#8230; </p>
<p>The post <a href="https://www.dennisbottaro.com/wordpress-themes/">WordPress Themes</a> appeared first on <a href="https://www.dennisbottaro.com">Dennis Bottaro</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>So, I&#8217;ve swapped from Libretto to FullWidther since I just wanted a wider main content area.  What I really should do is dig in and make a child theme based on the attributes of both themes that I really like.  Libretto has LOVELY typography, like seriously, really classy damned text, but its very narrow content area and really confused large image placement has me all jacked up.</p>
<p>Being that this is another way too late awake kind of night, I&#8217;ll just leave this right here.</p>
<p>The post <a href="https://www.dennisbottaro.com/wordpress-themes/">WordPress Themes</a> appeared first on <a href="https://www.dennisbottaro.com">Dennis Bottaro</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
