What you are trying to do is possible, but it's not that easy. To understand it is good to know what is happening with Web part properties that are set on a particular page. So - everytime to add a web part to a page and set its properties, the value in these properties are stored in Database along with Page template and its layout.
What this means is that in order for you to get any value from the web part you need to get it from the template and from the particular web part (based on its ID because there may be more same web parts on the same page)
Needless to say, this isn't possible without going to code and creating some Helper function/macro to help you with this. I've personally used this code to get value of a property of a web part on current page template:
PageTemplateInfo template = PageTemplateInfoProvider.GetPageTemplateInfo(CurrentPageInfo.GetUsedPageTemplateId());
if (template != null){
WebPartInstance thisWebPart = template.GetWebPart("QueryDataSource");
if (thisWebPart != null){
var someValue = thisWebPart.GetStringValue("SomeProperty", "");
}
}
This requires you to know the ID of the webpart which in my example was QueryDataSource.
In another scenario you can also loop trough all web parts and get its values like:
PageTemplateInfo pti = CurrentPageInfo.DesignPageTemplateInfo;
foreach (WebPartZoneInstance wpz in pti.WebPartZones)
{
foreach (WebPartInstance wpi in wpz.WebParts)
{
if (wpz.WidgetZoneType == WidgetZoneTypeEnum.None)
{
if (wpi.ControlID == "PagesDataSource")
{
var someValue = wpi.GetValue("SomeProperty").ToString();
}
}
}
}