Wednesday, August 26, 2009

Master Pages (part 1)

The design we were after was not a look and feel of out the box sharepoint so we needed to build a page that was different.

Step one:
Go to the MSDN site and grab their minimal master page, it makes life a little easier as you cover most of the bases sharepoint requires.

Step two:
Open sharepoint designer and edit this page.

OK that's the simple version.

Reason for step one - this is so don't miss any of the important controls needed to run sharepoint. Menus, being able to access "site actions" etc.

The first task is to add your own style to the master page, but NOT using <link> command as sharepoint designer not always likes this but use:
<sharepoint:cssregistration name="">" runat="server"/>&

As this seems to work better in designer!

Now my next task was to override all the horrible core.css styles - there are many ms- (ms-titlearea, etc.) styles to make life easier I replaced the ms- with XX- where XX is any meaningful name i.e. Site name.
Now I can add each of these XX's into my stylesheet and those controls keeping will look how I want and not how MS thought should look.

Now I have a master page with all the standard sharepoint stuff but with my theme/colours applied.

For my site I decided I only wanted the top bar in this master page. So after my top menu I cut most of the code out of <body> and just left a place holder that took up the full width of page area.

Now I created a "new from master page" and then this allowed me to alter the content place holder to custom content and saving this page as a master gave me a nested master page.

The outer master allows me to control the top menu and overall branding of site.
The inner master(s) allows me to control left navigation menus and main content area; and use own CSS stylesheet

Now do a "new from master" using the inner master add some webpart zones to this ASPX file and I now have a site template page I can create pages from.

I also created a second inner master to have a second look for some pages, just comes in handy when I don't want the left menu to appear.

itemstyle.xsl or using own testing style

So you want to make your webpart display in own style, well once you point your webpart to own file you need to create that file.


<xsl:template name="Testing" match="Row[@Style='Testing']" mode="itemstyle">
  <xsl:variable name="SafeLinkUrl">
      <xsl:call-template name="OuterTemplate.GetSafeLink">
       <xsl:with-param name="UrlColumnName" select="'LinkUrl'" />
      </xsl:call-template>
     </xsl:variable>
  <xsl:variable name="SafeImageUrl"><xsl:call-template name="OuterTemplate.GetSafeStaticUrl"><xsl:with-param name="UrlColumnName" select="'ImageUrl'" /></xsl:call-template></xsl:variable>
  <xsl:variable name="DisplayTitle"><xsl:call-template name="OuterTemplate.GetTitle"><xsl:with-param name="Title" select="@Title" /><xsl:with-param name="UrlColumnName" select="'LinkUrl'" /></xsl:call-template></xsl:variable>
  <xsl:variable name="LinkTarget"><xsl:if test="@OpenInNewWindow = 'True'">_blank</xsl:if></xsl:variable>
  <div id="linkitem" class="item">
   <xsl:if test="string-length($SafeImageUrl) != 0">
    <div class="image-area-left">
     <a href="{$SafeLinkUrl}" target="{$LinkTarget}">
      <img class="image" src="{$SafeImageUrl}" alt="{@ImageUrlAltText}" />
     </a>
    </div>
   </xsl:if>
   <div class="link-item">
    <xsl:call-template name="OuterTemplate.CallPresenceStatusIconTemplate" />
    <a href="{$SafeLinkUrl}" target="{$LinkTarget}" title="{@LinkToolTip}">
     <xsl:value-of select="$DisplayTitle" />
    </a>
    <div class="description">
     <xsl:value-of select="@Description" />
     <xsl:for-each select="@*">
     P:<xsl:value-of select="name()" />(<xsl:value-of select="."/>)
    </xsl:for-each>
    </div>
   </div>
  </div>
 </xsl:template>
 



This I save in the same place as ItemStyle.xsl and call Internet.xsl, it has a default style (from itemstyle.xsl) so when switch to using it won't break the webpart. Then it has a testing style that allows me to see if the "CommonFields" I added are working and show correct value.

From the testing I can then create a new style to display those fields how I want.

Within my next posts I'll explain more on XSL; I have found this to be great once I understood what it can do...

Using own xsl style sheet

For this month I have been working on SharePoint, building an internet site, having built an intranet site at the start of the year now starting this I had forgotten a lot of what learnt so this time I'm going to blog it here (until I move to own site).

Well I added a Content Editor Web Part (or CEWP or should that be Webpart) to my page and modify it to pull the correct datasource all simple and through the webpage.

Now I need to customise it... Two things need to do firstly get it to display my custom fields and secondly use my own style sheet. The second is to avoid changing the default itemstyle.xsl.

I created a xsl and added a testing template to it (in another post)

Now export the CEWP; you can now open this file with Notepad.

Look for the property called "ItemXslLink" and modify it to point to own style sheet:
" <property name="ItemXslLink" type="string">/Style Library/XSL Style Sheets/Internet.xsl</property>"

Then look for "CommonViewFields" and add your custom fields:
" <property name="CommonViewFields" type="string">ShareholderDetails, Text;URL, URL</property>"

Now save it, delete the one on your Web Part Page and import this modified version.

Now your webpart will display the extra fields need and use own styles.

More sharepoint posts to follow

Wednesday, January 28, 2009

SharePoint CSS Viewer

Just add the following to a editor web part thingy:

<script language="JavaScript">
function elementInfo()
{
//Output CSS Class Hierarchy
var currElement = window.event.srcElement;
var classTree = "";
var n = 50;

//Show first n characters of tagName in TAG cell
if(currElement.tagName != null)
{
ststag.innerText = "<" + currElement.tagName + ">";
if(ststag.innerText.length > n)
ststag.innerText = ststag.innerText.substring(1,n) + "...";
}
else
ststag.innerText = "";

//Show first n characters of id in ID cell
if(currElement.id != null)
{
stsid.innerText = currElement.id;
if(stsid.innerText.length > n)
stsid.innerText = stsid.innerText.substring(0,n) + "...";
}
else
stsid.innerText = "";

//Show first n characters of name in NAME cell
if(currElement.name != null)
{
stsname.innerText = currElement.name;
if(stsname.innerText.length > n)
stsname.innerText =
stsname.innerText.substring(0,n) + "...";
}
else
stsname.innerText = "";

//Show entire class parentage in the CLASS cell
if(currElement != null)
{
do
{
if(currElement.className != null &&
currElement.className != "")
{
if(classTree != "")
classTree = currElement.className + "\n" + classTree;
else
classTree = currElement.className;
}
currElement = currElement.parentElement;
} while (currElement != null);
stsclass.innerText = classTree;
}
else
{
stsclass.innerText = "";
}
}

//Run code on all mouse over events
window.document.body.onmouseover = elementInfo;
</script>

<table border="1" height="220" width="100%">
<tbody><tr>
<td valign="top">
TEST
</td>
<td valign="top" width="100%">
<table>
<tbody><tr>
<td>TAG:</td>
<td id="ststag" width="100%">
</td>
</tr>
<tr>
<td>ID:</td>
<td id="stsid">
</td>
</tr>
<tr>
<td>NAME:</td>
<td id="stsname">
</td>
</tr>
<tr>
<td valign="top">CLASS:</td>
<td id="stsclass">
</td>
</tr>
</tbody></table>
</td>
</tr>
</tbody></table>

Thursday, November 06, 2008

What is the Origin of 'Yes, We Can!'

I also want to know if BO is taking inspiration from Bob the builder...

Had all that about Joe the Plumber so maybe that was the theme of the election - the working man!

Over at ZaidLearn: SciVee and The Origin of 'Yes, We Can!' there is reference to a latin origin!

So hope to find out soon where this phase came from, but I really want it to be from Bob.

Then look forward to yet more quotes from kids shows...

Oh, BO is such an unfortunate set of initials, and when the dust settles and people start attacking Barack how many jokes about "he stinks" will there be!!!

Friday, September 05, 2008

Summary of “How competitive forces shape strategy” by Porter, M


The strongest competitive force or forces determine the profitability of an industry and so are of the greatest importance in strategy formulation.
Force 1: Threat of entry – New competition, new ideas, shakes up the industry. Six major barriers to entry reduce the threat.
· Economies of scale
· Product differentiation
· Capital requirements
· Cost disadvantages independent of size (learning curves)
· Access to distribution channels
· Government policy
Force 2: Bargaining power of suppliers – Suppliers ability to raise prices without losing business.
· Dominated by few companies and concentrated more than market selling to
· Lack of substitutes
· Unique product, high switching costs
· Industry of low importance to supplier group
Force 3: Bargaining power of buyers – Buyers can choose whom to buy from so Industry must compete for the business.
· Buyer buys large volumes
· Buys a standard product
· Product forms significant fraction of buyers selling costs
· Buyer has low profit
· Industry product quality not important to buyer
· Industry product does not save buyer money
· Buyer can integrate backwards to make the industry product
Force 4: Substitute products – Buyers could move to another product and not by from this industry.
Finally Force 5: Jockeying for position – Competition within the industry, price competition, product introduction and advertising wars.
· Numerous competitors
· Slow industry growth
· Similar product and little switching cost
· High fixed costs or perishable product
· Capacity is normally augmented in large increments
· Exit barriers high
· Rivals have diverse strategies

Summary of “The competitive advantage of nations” by Porter, M

The diamond shows the four keys that influence the competitiveness of nations.
Depending on how well a company performs domestically and the nature of the home markets can determine how it performs globally.
Factor Conditions – A nations position in factors of production, skills, infrastructure, resources, capital and land. Having an advantage in these areas adds to the overall competitive advantage. However, where have no advantage, Japan lacks natural resources, and then companies’ ability to innovate and upgrade technology to overcome this disadvantage is key in the overall competitive advantage.
Demand Conditions – If there is a highly competitive home market of discerning consumers creating a high domestic demand for quality, innovative and advanced products then for the company to survive it must become the best locally. If able to compete in an aggressive local market then the company is likely to compete equally as well in the global market.
Related and Supporting Industries – The suppliers of a company should also be a globally competitive supplier so that get best from them, same diamond conditions should apply to supplier. Then company will get best prices and best quality so the related industries become equally valuable to the nation as the companies the supply. Spin off products / companies will arise out of a successful support industry furthering the global competitiveness of the nation.
Firm Strategy, Structure and Rivalry – The firms’ strategy and structure must fit into the local environment and fit the company, so that company will grow. Again, skills and the motivation to apply those skills are important in the growth. Another point reiterated here is rivalry among local firms as this stimulates the growth of an industry in that region.
Governments’ role – This is to push or encourage firms, to raise them and for them to move to higher levels of competitive performance. In democratic countries where a party will only have power for a short term, then policies tend to be short-term – to win popularity and stay in power. The policies that would make a difference usually take to long for a politician to want to implement. The policies that government should implement are to support national competitiveness: encourage change, promote domestic competition and stimulate rivalry. The other key role government needs to enforce is strict product safety and environmental standards, if firms have to comply in domestic market to stringent standards then in the global market will have an advantage.
Company agendas
The leadership of company needs to encourage and seek out challenges and pressures to make the company continuously innovate and upgrade so that their level of competitiveness increases, make the suppliers firm deals with supply at a high standard of quality so further promotes growth in those markets. By growth, they create jobs boosting other areas of the economy.

Summary of “What is Strategy?” by Porter, M

In the beginning there was Operational Effectiveness, but this has just led to an optimisation of companies with very little direction and strategic vision.
“Competitive strategy is about being different”: This is the way that you choice to service your customers, or present what you are offering, are distinctly different from those of your competitors. If this is just a statement and not an action then the competition will win if they have a strategy that they actually implement.
Strategic Positions
· Variety Based Positioning – companies that within an industry offering a wide variety of choices choose to specialise in just one, so they can offer superior value for a particular service.
· Needs Based Positioning – Company strategy is to focus on a specific need of a customer base and meet all their needs in this one area, the example sited is Ikea targets young, not wealthy, likely to have children family’s and meets all their furniture needs in one store. Then the company must have a unique value proposition to meet these needs.
· Access Based Positioning – If there is a specific way that deal with your customer base, only dealing with rural customers that might mean no transport so have to take your product to them.
Therefore, an answer to the question posed becomes “Strategy is the creation of a unique and valuable position, involving a different set of activities”.
Trade-offs needed
To maintain a strategic advantage requires some trade-offs, to be able to maintain a position you have to give up something which then prevents you from changing your position without incurring costs. This also means competitors who try to straddle across their existing market and then copy your model have to give up, or accept new, practices required for their existing position which then either makes it cost ineffective to compete in same sphere or cause irregularities in their brand or reputation.
Again this refines our answer, “Strategy is making trade-offs in competing. The essence of strategy is choosing what not to do.”
Fit
· Simple Consistency – Each activity and the overall strategy work together
· Reinforcing – Activities build on the strategy
· Optimisation of effort – Processes optimised towards the strategy.
The activities that company doing as it strategy make it harder for competition to copy without having to copy the whole system.
Thus, the final answer to “What is strategy? Strategy is creating fit among a company’s activities. The success of a strategy depends on doing many things well – not just a few – and integrating among them. If there is no fit among activities, there is no distinctive strategy and little sustainability.”
With the answer to what is a strategy, the problem then moves to not ‘sticking to your guns’ and in the chasing of profit losing track of your goal as defined by the strategy. As with Neutrogena moving into the mass merchandisers away from the drug store, they are no longer unique and their image becomes diluted.
However, to obtain profitable growth companies must reinforce their activities that fit with the strategy, focus on meeting those needs, and unless rework and refocus the complete company strategy then do not change what doing if it is in line with the current strategy. The leadership of the company must keep a tight rein on direction the company is taking to ensure inline with the strategy.
In closing, managers must differentiate between operational effectiveness and strategy, as both are essential and both are different.

Summary of “Can you say what your strategy is?” by Collis, D and Rukstad, M

There are three critical components of a good strategy statement:
· Objective,
· Scope, and
· Advantage
That is the focus of the article.
Objective:
From a strategic viewpoint is a clear, concise, measurable and time based goal; unlike a mission statement that is the main objective referred to when referring to a company’s objective as these are more the values of the company than the clear goal of the company.
Scope:
This is split into three areas customer or offering, geographic location and vertical integration.
The scope is not as clear-cut as the objective, as it allows for flexibility by employees, but will specify areas that the company is not considering entering, so in case Jones targets the “delegator” and not the “validator” or the “do-it-yourselfer”. With whom they going to do business they are very specific on the two types of customer do not want.
Advantage:
The key ingredient to a strategy statement, this adds clarity about what makes the firm unique and helps employees understand how they contribute to the success of the strategy.
So putting all these together, you can then move into developing your strategy statement, this requires evaluation of the industry, understanding of customer needs, segmentation of customers, and then identifying what unique value, you offer. The company capabilities’ and those of the competitors, from this you can then work where the ‘strategic sweet spot’ is, the point where company is meeting customers needs that a competitor cannot.

Thursday, September 04, 2008

Screen Saver Disabled Registry Setting

OK so I couldn't change my screensaver as the dropdown had been disabled.

To fix this delete the registry keys under:

HKCU\software\policies\microsoft\windows\control panel\desktop

Then run
%SystemRoot%\System32\RUNDLL32.EXE user32.dll, UpdatePerUserSystemParameters
so dont need to reboot to make effective.

Now posted here I should never forget...

Monday, May 05, 2008

Maths

I am trying to make sense of this...

Demand is > P = A - BQ
TR = P * Q = AQ-B(QQ)
MR = A - 2BQ

Studying Economics


So I have been studying...

Macro Economics - The study of how different markets interact in the aggregate.

Money Market

Real Money Supply = M/P

Liquidity L=f(r, Y)

Transmission Mechanism

Liquidity of Money LM = Money Supply / Price = M/P

Investment Savings IS
IS = f(G,Yf, e, conf)

Goods Market (the aggregate supply and demand)

AS = f(oil, wage, etc.) AD = f(G,conf,e,Yf,M/P)





Thursday, September 27, 2007

SA Rocks

sarocks_badge.jpgSo just found this site and seems to be somewhere with a positive attitude to SA so well worth a look at! Well I even posted a comment there on the 'murder most foul' blog thing.

Thursday, August 30, 2007

Richard Dawkins - The God Delusion

Just finished reading the "God Delusion" great book just read it...

Synopsis - from Amazon.co.uk
"The God Delusion" caused a sensation when it was published in 2006. Within weeks it became the most hotly debated topic, with Dawkins himself branded as either saint or sinner for presenting his hard-hitting, impassioned rebuttal of religion of all types. His argument could hardly be more topical. While Europe is becoming increasingly secularized, the rise of religious fundamentalism, whether in the Middle East or Middle America, is dramatically and dangerously dividing opinion around the world. In America, and elsewhere, a vigorous dispute between 'intelligent design' and Darwinism is seriously undermining and restricting the teaching of science. In many countries religious dogma from medieval times still serves to abuse basic human rights such as women's and gay rights. And all from a belief in a God whose existence lacks evidence of any kind. Dawkins attacks God in all his forms. He eviscerates the major arguments for religion and demonstrates the supreme improbability of a supreme being. He shows how religion fuels war, foments bigotry and abuses children. "The God Delusion" is a brilliantly argued, fascinating polemic that will be required reading for anyone interested in this most emotional and important subject.


Wednesday, September 27, 2006

If

I recently came across this again and as I'm in a posting mood, thought I'd breach any copyright that exists on this and post it:

If ...

If you can keep your head when all about you
Are losing theirs and blaming it on you;
If you can trust yourself when all men doubt you,
But make allowance for their doubting too;

If you can wait and not be tired by waiting,
Or, being lied about, don't deal in lies,
Or, being hated, don't give way to hating,
And yet don't look too good, nor talk to wise;

If you can dream - and not make dreams your master;
If you can think - and not make thoughts your aim;
If you can meet with triumph and distaster
And treat those two impostors just the same;

If you can bear to hear the truth you' ve spoken
Twisted by knaves to make a trap for fools,
Or watch the things you gave your life to broken,
And stoop, and build 'em up with worn-out tools;

If you can make one heap of all your winnings
And risk it on one turn of pitch-and-toss,
And lose, and start again at your beginnings
And never breathe a word about your loss;

If you can force your heart and nerve and sinew
To serve your turn long after they are gone,
And so hold on when there is nothing in you
Except the will which says to them: "Hold on!"

If you can talk with crowds and keep your virtue,
Or walk with kings - nor lose the common touch;
If neither foes nor loving friends can hurt you;
If all men count with you, but none too much;

If you can fill the unforgiving minute
With sixty seconds' worth of distance run
Yours is the Earth and everything that's in it,
And - which is more - you'll be a man my son!

Rudyard Kipling